-
-
Notifications
You must be signed in to change notification settings - Fork 781
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
Run SAST checks in CI #7674
Run SAST checks in CI #7674
Conversation
✅ Deploy Preview for inventree-web-pui-preview canceled.
|
This will require the enviroment variable |
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
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.
Q: when should this workflow execute? Are you aware, that this secret is never available with the pull_request trigger, due to protection mechanisms?
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 is 1:1 from the docs of SonarCloud, I trust that they validated this approach
https://github.com/SonarSource/sonarcloud-github-action?tab=readme-ov-file#usage
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.
Ok, interesting, GitHub itself tells something else, but happy to have learned something new.
@matmair |
Sonar / @agigleux have fixed the underlying issue, this is not needed anymore. @SchrodingersGat you can remove the secret |
Awesome, thanks @agigleux and Sonar! |
We are currently failing the SAST section of https://securityscorecards.dev/viewer/?uri=github.com/inventree/InvenTree because it seems like SonarCloud is not running on (all?) PRs. The easiest solution for this is to just run it in CI, this should also help to discover problematic code sooner.
This PR: