Skip to content

Commit 5c9b076

Browse files
authored
Merge pull request #2 from scanapi/feat-implements-action
feat: Initial implementation
2 parents e6b6e08 + 713d083 commit 5c9b076

4 files changed

Lines changed: 63 additions & 4 deletions

File tree

Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ RUN pip install pip setuptools --upgrade
88

99
RUN pip install scanapi
1010

11-
COPY . /app
11+
ENTRYPOINT ["/entrypoint.sh"]
1212

13-
WORKDIR /app
14-
15-
CMD ["scanapi"]
13+
COPY entrypoint.sh /entrypoint.sh

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# scanapi
2+
An action that allows developers to run ScanAPI using github actions.
3+
4+
## Inputs
5+
6+
### `arguments`
7+
8+
Desired arguments to run scanapi. Allow multiple parameters separated by spaces. Default value is `--help`
9+
10+
## Example usage
11+
12+
The following will take the yaml file and produce a scanapi-report.html file as output.
13+
14+
```yaml
15+
- name: Run automated API tests
16+
uses: scanapi/scanapi@v1
17+
with:
18+
arguments: 'scanapi.yaml'
19+
```
20+
21+
## Example workflow
22+
23+
Complete example used in a workflow/yaml file. This produce a scanapi-report.html file as output.
24+
25+
```yaml
26+
name: Run tests
27+
on:
28+
pull_request:
29+
types: [opened, synchronize]:
30+
31+
jobs:
32+
Test:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v2
36+
- name: Run automated API tests
37+
uses: scanapi/scanapi@v1
38+
with:
39+
arguments: 'scanapi.yml'
40+
```

action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: 'Run ScanAPI action'
2+
author: '@scanapi'
3+
description: 'Allows any developer to run ScanAPI using github actions'
4+
branding:
5+
icon: 'align-justify'
6+
color: 'gray-dark'
7+
inputs:
8+
arguments:
9+
description: 'Desired arguments to run scanapi. Allow multiple parameters separated by spaces.'
10+
required: true
11+
default: '--help'
12+
runs:
13+
using: 'docker'
14+
image: 'Dockerfile'
15+
args:
16+
- ${{ inputs.arguments }}

entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
scanapi "$@"

0 commit comments

Comments
 (0)