-
Notifications
You must be signed in to change notification settings - Fork 731
[GH-1977] Added zizmor with pre-commit #1982
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
base: master
Are you sure you want to change the base?
Conversation
@Aashish-Jha-11 please fix the lint issue |
Passed test on pre-commit install pre-commit run --all-files
Fixed Alignment Causing Lint Error
Thank you for the review and feedback! |
- Added zizmor static analysis tool for GitHub Actions security scanning - Fixed unpinned r-lib action references in r.yml by specifying SHA hashes - Updated hook configuration to scan workflow files for security issues
I've enhanced our CI/CD security by adding the zizmor static analysis tool to our pre-commit configuration. This addition helps protect our GitHub Actions workflows from common security vulnerabilities. Changes made: Repository: https://github.com/zizmorcore/zizmor-pre-commit Updated r.yml workflow to use commit SHA pinning instead of version tags Unpinned action references (which could be hijacked) |
.github/workflows/r.yml
Outdated
shell: bash | ||
- uses: actions/checkout@v4 | ||
- uses: r-lib/actions/setup-r@v2.11.3 | ||
- uses: r-lib/actions/setup-r@bd49c52ffe281809afa6f0fecbf37483c5dd0b93 |
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 this because this commit belongs to an unreleased version?
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.
Thanks for pointing that out,
Yes, this is because GitHub Actions security best practices recommend pinning to a full commit SHA instead of using version tags, which are mutable.
I verified that bd49c52... is the current commit behind v2.11.3 at the time of change, so this ensures reproducibility and avoids any tampering even if the tag is moved in the future.
Let me know if you'd prefer using a different version or want it changed back to tag-based reference. 😊
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.
thanks for the detailed explanation. I actually prefer the tag-based reference. Would you please change it back?
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.
Sure! I’ll switch it back to the tag-based reference as suggested. Thanks again for the clarification and feedback — learning a lot through this process! 😊
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 @jiayuasu Sir,
I'm currently facing some lint issues related to GitHub Actions. One of the errors is error[unpinned-uses], which occurs when actions are referenced using tags like @v2.11.3. To fix this, I tried using the full commit SHA instead, since the linter requires pinning to a specific version hash for security.
Would you mind helping me with the correct way to handle this? I just want to make sure I'm following the project's guidelines properly.
Thank you!
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 @jiayuasu Sir, I'm currently facing some lint issues related to GitHub Actions. One of the errors is error[unpinned-uses], which occurs when actions are referenced using tags like @v2.11.3. To fix this, I tried using the full commit SHA instead, since the linter requires pinning to a specific version hash for security.
Would you mind helping me with the correct way to handle this? I just want to make sure I'm following the project's guidelines properly.
Thank you!
Hello @Aashish-Jha-11 you can use a config file to ignore some audit rules
https://docs.zizmor.sh/configuration/
Read up on the rules here:
Hey @Aashish-Jha-11 you should read about pre-commit in the Sedona docs. pre-commit is running on the CI with GitHub Actions but pre-commit is really a git hooks framework which can also run on your local machine before pushing up to GitHub. So you can test on your local machine with the audit rules and config file https://sedona.apache.org/latest-snapshot/setup/compile/#pre-commit If you are not really sure how to finish this PR I can try to finish it. Since you have already done some work we can always use another PR that I create and we can put you down as the commit co-author so you get credit for the existing work. |
Hi @jbampton , Thank you so much for explaining and for sharing the helpful links. Since this is my first time contributing to a large open-source project like this, I’ve tried multiple approaches to fix the pre-commit and lint issues locally, but I’m still getting stuck. If it’s okay, I would really appreciate it if you could help finish this PR and add me as a co-author for the contribution. Thanks again for your guidance and support! |
Did you read the Contributor Guide?
Is this PR related to a ticket?
zizmor
with pre-commit #1977What changes were proposed in this PR?
Did this PR include necessary documentation updates?