Skip to content

use zizmor to lint github action workflows#11269

Open
keewis wants to merge 26 commits intopydata:mainfrom
keewis:zizmor
Open

use zizmor to lint github action workflows#11269
keewis wants to merge 26 commits intopydata:mainfrom
keewis:zizmor

Conversation

@keewis
Copy link
Copy Markdown
Collaborator

@keewis keewis commented Mar 29, 2026

In times of AI-driven attacks on github actions (where the AI agent drastically reduces the effort needed to attack multiple repositories), it is a good idea to try as much as possible to avoid any of the foot guns that github actions provide.

zizmor is a github actions linter (with autocorrection functionality) that flags many potentially exploitable parts as possible.

For xarray, most of the changes were pinning the actions and limiting the permissions for the default GITHUB_TOKEN.

Note that while I've tried to figure out the needed permissions for each job, I'm not certain I found everything, so merging this may result in breaking CI on main.

I've also created new github environments for the codecov token and the nightly wheels token, which are now duplicated between the environment secrets and the repository secrets. After merging (and making sure the tokens are available as usual) it might be good to remove the repository secrets.

Edit: I've removed the codecov env and instead will ignore the zizmor warning, codecov is not a very sensible secret, and the "deployment" messages in PRs (see below) quickly become annoying.

@github-actions github-actions bot added the Automation Github bots, testing workflows, release automation label Mar 29, 2026
@keewis
Copy link
Copy Markdown
Collaborator Author

keewis commented Mar 29, 2026

looks like the deployment messages for codecov may become annoying. This token is not a very sensible secret, so it may also be possible to remove the environment and instead ignore zizmor's warning (codecov is one of the kind of token the warning description explicitly shows how to ignore).

Edit: I've done just that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Automation Github bots, testing workflows, release automation run-pyright Run pyright type checker run-slow-hypothesis Run slow hypothesis tests run-upstream Run upstream CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant