-
Couldn't load subscription status.
- Fork 738
Lint Github Actions workflows with zizmor #3188
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: devel
Are you sure you want to change the base?
Changes from all commits
510ddb5
860767b
2048554
fdaae59
f67e137
5214e73
bb63f4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,5 @@ updates: | |
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| cooldown: | ||
| default-days: 4 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| rules: | ||
| unpinned-uses: | ||
| config: | ||
| policies: | ||
| "wntrblm/nox": ref-pin | ||
| "re-actors/alls-green": ref-pin | ||
| "actions/*": ref-pin |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -140,6 +140,15 @@ def actionlint(session: nox.Session) -> None: | |||||
| ) | ||||||
|
|
||||||
|
|
||||||
| @nox.session | ||||||
| def zizmor(session: nox.Session) -> None: | ||||||
| """ | ||||||
| Ren zizmor, a Github Actions security checker | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| """ | ||||||
| install(session, req="zizmor") | ||||||
| session.run("zizmor", "--persona=regular", ".github/workflows") | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to allow passing the persona as an arg? It could be persona by default but perhaps there could be cases where I'd want to use this session to conduct an audit and set |
||||||
|
|
||||||
|
|
||||||
| @nox.session | ||||||
| def lint(session: nox.Session): | ||||||
| session.notify("typing") | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| zizmor |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # This file was autogenerated by uv via the following command: | ||
| # uv pip compile --universal --output-file tests/zizmor.txt tests/zizmor.in | ||
| zizmor==1.16.0 | ||
| # via -r tests/zizmor.in |
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.
We could potentially remove this in favor of the workflow added in #3141 and just keep the zizmor in the noxfile for contributors to run locally.
Although, I'm concerned that:
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.
The zizmor workflow not failing CI seems to be by design of the GHA author, keeping that data in the security section for action separate from success/failure of the CI itself.
As for not being able to find the reported issues, that was a "I needed to learn how to use the tools together". I was running the scans on one branch, and the scan was showing data from another, and I just missed how I could adjust that to see the results (all of that was happening in my own fork).
With all that being said, since a majority of the workflows for the project are setup using nox to make them portable between dev/CI environments, I can't think of any good objections to integrating it there. I initially went the GHA route because it appears to be the suggested method by the tool authors, with the intention of piping that data automatically into existing GH systems (which does work as intended, but doesn't sound like its exactly the use case we're targeting).