-
Notifications
You must be signed in to change notification settings - Fork 2
Add-scanapi-version #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@ShubhamSood1406 for this issue we need to install the scanapi with the corresponding version received from the parameter. I only see the README.md file changed here. Was it by mistake? |
Can you explain what else to change to fix this issue? |
@ShubhamSood1406 I believe these are the steps to make it work:
|
@camilamaia I updated the files, please review it and tell if I need to change anything else. |
@ShubhamSood1406 thanks for the changes! Just one caveat here, we need to ensure all the scanapi CLI arguments will be passed too. This commented line was responsible to do it. You still need to pass all the arguments, except the first, which is the version one. Also, would you mind ppdating the README inputs section with the input |
@camilamaia I updated the file, please check and tell if anything else to change. |
@camilamaia Please review this PR to be accepted in Hacktoberfest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I left the suggestions in order to make it work.
Here is the example I used to test it:
This was the key to solve it: https://stackoverflow.com/questions/9057387/process-all-arguments-except-the-first-one-in-a-bash-script
@@ -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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scanapi_version: '==2.0.0' | |
scanapi_version: '2.0.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for removing this feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me. I would probably add a feature to specify the version in PIP version specifier syntax ('==1.2.3', '~=1.2', etc.) as it was added by @ShubhamSood1406. This would add the capability for users to automatically use the latest version if the patch version is changed and not to update when major updates (with braking changes) occur.
Oh, that makes sense, now I got the point of the way you implemented it on poetry-publish. I agree with you 👍
README.md
Outdated
@@ -5,6 +5,10 @@ An action that allows developers to run ScanAPI using github actions. | |||
|
|||
## Inputs | |||
|
|||
### `scanapi_version` | |||
|
|||
Default version of scanapi to install. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default version of scanapi to install. | |
The version of ScanAPI to install (default: latest). |
sh -c "scanapi $*" | ||
|
||
if [ $1 != 'latest' ]; then | ||
pip install scanapi$1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip install scanapi$1 | |
pip install "scanapi=="$1 |
@JRubics I added you to review this PR since you are the github action expert here! Feel free to suggest any changes :) |
Done with the changes according to the suggestions. You can review it. @camilamaia |
Everything looks good to me. I would probably add a feature to specify the version in PIP version specifier syntax ('==1.2.3', '~=1.2', etc.) as it was added by @ShubhamSood1406. This would add the capability for users to automatically use the latest version if the patch version is changed and not to update when major updates (with braking changes) occur. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShubhamSood1406 I made the suggestions based on what @JRubics proposed. Sorry for the rework, I did not get the idea of the feature before.
@@ -1,5 +1,9 @@ | |||
#!/bin/bash | |||
|
|||
set -e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShubhamSood1406 can we have this back?
README.md
Outdated
@@ -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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scanapi_version: '2.0.0' | |
scanapi_version: '==2.0.0' # (PIP version specifier syntax) |
entrypoint.sh
Outdated
@@ -1,5 +1,9 @@ | |||
#!/bin/bash | |||
|
|||
set -e | |||
if [ $1 != 'latest' ]; then | |||
pip install "scanapi=="$1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip install "scanapi=="$1 | |
pip install scanapi$1 |
Done @camilamaia |
#3 is solved now and ready to be merged.