-
Notifications
You must be signed in to change notification settings - Fork 138
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
fix: use post-entrypoint script to run cleanup tasks #33
fix: use post-entrypoint script to run cleanup tasks #33
Conversation
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.
Hi @bsvobodny.
Thank you very much for your contribution! I just have 1 small nitpick, and we must update the tests to take this new script into consideration. Could you please update 🙏 ? Let me know if you need any help.
FYI, I've opened a ticket to track this on our side: https://jira.sonarsource.com/browse/SQSCANGHA-3
_tmp_file=$(ls "${INPUT_PROJECTBASEDIR}/" | head -1) | ||
PERM=$(stat -c "%u:%g" "${INPUT_PROJECTBASEDIR}/$_tmp_file") | ||
|
||
chown -R $PERM "${INPUT_PROJECTBASEDIR}/" |
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.
This will fail the tests, because right now it doesn't take into account the fact it should run a "post entrypoint" script. Could you add the following line after line 93 here (i.e., after the existing docker run
command):
docker run -v `pwd`:/github/workspace/ --workdir /github/workspace --network $network --env INPUT_PROJECTBASEDIR=/github/workspace --entrypoint /cleanup.sh sonarsource/sonarqube-scan-action
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.
Sorry, I was not able to run the tests locally (I'm on macos... ), that's why I wanted to run the qa worklfow manually.
I will add this line to the run-qa.sh
file
Co-authored-by: Wouter Admiraal <45544358+wouter-admiraal-sonarsource@users.noreply.github.com>
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.
Perfect! Thank you very much for your contribution!
This contribution is made to fix the issue #31.
We are using the post-entrypoint property of the
docker
github action to run the cleanup and but set the right permissions to all workspace file.In this case if the scan action fails or is cancelled, the post-action will run and set the right permissions to all files.