Skip to content

Commit

Permalink
Add-scanapi-version (#4)
Browse files Browse the repository at this point in the history
Add scanapi_version parameter
  • Loading branch information
ShubhamSood1406 authored Oct 19, 2020
1 parent c3e6108 commit 90d4c50
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ ENV PATH="~/.local/bin:${PATH}"

RUN pip install pip setuptools --upgrade

RUN pip install scanapi

ENTRYPOINT ["/entrypoint.sh"]

COPY entrypoint.sh /entrypoint.sh
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ An action that allows developers to run ScanAPI using github actions.

## Inputs

### `scanapi_version`

The version of ScanAPI to install (default: latest).

### `arguments`

Desired arguments to run scanapi. Allow multiple parameters separated by spaces. Default value is `--help`
Expand All @@ -17,6 +21,7 @@ The following will take the yaml file and produce a scanapi-report.html file as
- name: Run automated API tests
uses: scanapi/github-action@v1
with:
scanapi_version: '==2.0.0'
arguments: 'run ./scanapi.yaml'
```
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ branding:
icon: "align-justify"
color: "gray-dark"
inputs:
scanapi_version:
description: 'The ScanAPI version to be installed'
required: false
default: 'latest'
arguments:
description: "Desired arguments to run ScanAPI. Allow multiple parameters separated by spaces."
required: true
Expand All @@ -13,4 +17,5 @@ runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.scanapi_version }}
- ${{ inputs.arguments }}
8 changes: 7 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@

set -e

sh -c "scanapi $*"
if [ $1 != 'latest' ]; then
pip install scanapi$1
else
pip install scanapi
fi

sh -c "scanapi ${@:2}"

0 comments on commit 90d4c50

Please sign in to comment.