Add zizmor pre-commit and fix reported issues#2381
Conversation
seefood
left a comment
There was a problem hiding this comment.
I played with the idea, but I think it's an overkill to add this as a pre-commit dependency... this is maybe more of a post-commit action in the CI? what do you think?
It will run only if the github workflow are modified in the commit AND if the user has installed the precommit hook. Running
At the moment it's neither. It will only run if we install the pre-commit hook with I can modify the CI to run it if the workflow are modified in the PR. My goal is to enforce a minimum of security with github action on this project. |
|
maybe we should use zizmorcore/zizmor-action@71321a2 instead in the workflow? I don't want to force the users to instal zizmor just for us. alternatively: quietly skip the prek test if zizmor is not installed? |
Yes, I can work on that.
This is not the goal. The pre-commit hooks are only installed manually if someone want to test bash-it automatically when doing a new commit on the repo, as outlined in https://bash-it.readthedocs.io/en/latest/development/#using-the-pre-commit-hook. The zizmor hook does't need zizmor installed, pre-commit will will download it in a specific venv to test the commit. |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
|
Ideally I want people to install prek (or pre-commit) if they want to submit a PR. we already assume they install shfmt and shellcheck, but I don't want them to have to install zizmor. the action is good enough, as the workflows are part of the CI, not really part of the bash-it project. |
|
Note that #2383 should be merge before for the CI to pass. |
Description
https://github.com/zizmorcore/zizmor is a static analysis tool for github action.
This PR add a precommit hook to check the CI workflow if modified.
Motivation and Context
Github workflow can be a security issue when not configured properly.
Zizmor will check for issues and report recommantion on how to fix those.
How Has This Been Tested?
❯ zizmor .github/ 🌈 zizmor v1.23.1 INFO audit: zizmor: 🌈 completed .github/workflows/ci.yml No findings to report. Good job! (9 suppressed)Types of changes
Checklist:
clean_files.txtand formatted it usinglint_clean_files.sh.