Skip to content

Improve the security of GitHub Action workflows#2952

Merged
bouweandela merged 6 commits intomainfrom
adopt-zizmor
Jan 26, 2026
Merged

Improve the security of GitHub Action workflows#2952
bouweandela merged 6 commits intomainfrom
adopt-zizmor

Conversation

@bouweandela
Copy link
Member

@bouweandela bouweandela commented Jan 26, 2026

Description

Adopt zizmor to improve the security of our GitHub Action workflows and add some schema checks too.


Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.62%. Comparing base (9a05643) to head (da315df).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2952   +/-   ##
=======================================
  Coverage   95.62%   95.62%           
=======================================
  Files         266      266           
  Lines       15601    15601           
=======================================
  Hits        14918    14918           
  Misses        683      683           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

matrix:
python-version: ["3.12", "3.13", "3.14"]
architecture: ["x64"] # need to force Intel, arm64 builds have issues
architecture: ["x64"] # need to force Intel, arm64 builds have issues
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@valeriupredoi I seem to remember we had issues with this in ESMValTool, should we use the "default" architecture instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes - did we not change to arm for all our OSX GHAs?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I mean, delete the arch: x64 line, not specifically request an arm arch) - proves we didn't - can you delete that here pls, bud?

@valeriupredoi
Copy link
Contributor

valeriupredoi commented Jan 26, 2026

good idea to secure our GHAs - but I reckon we ought to do that only for the GHAs that allow some two-way interaction between the runner and our repo ie those that open auto PRs; I am a bit scared of this tool though, have a look at the limitations listed in this article https://grafana.com/blog/how-to-detect-vulnerable-github-actions-at-scale-with-zizmor/

I honestly don't se any point fretting about the GHAs that don't allow any interaction with our repo, bud 🍻

Co-authored-by: bouweandela <bouweandela@users.noreply.github.com>
Co-authored-by: Valeriu Predoi <valeriu.predoi@gmail.com>
@bouweandela bouweandela marked this pull request as ready for review January 26, 2026 15:07
@bouweandela
Copy link
Member Author

Which limitations do you mean specifically? I don't see any that would affect us.

I'm not terribly concerned about us getting hacked as we're such a small community, but I think it's nice to at least try to prevent it.

@valeriupredoi
Copy link
Contributor

Which limitations do you mean specifically? I don't see any that would affect us.

I'm not terribly concerned about us getting hacked as we're such a small community, but I think it's nice to at least try to prevent it.

this one:

  1. Rate limiting

Firstly, GitHub’s rate limiting of repository and application tokens causes some headaches when running the online checks that Zizmor can do. This is down to the fact that Zizmor uses the GitHub API to fetch the tags and branches for a given action. When this is done at scale, and on large projects, you quickly hit GitHub’s 15,000 calls per hour. It looks like the maintainer has already started thinking about this use case in this issue.

@bouweandela
Copy link
Member Author

Let's see about that when we get there. It says the issue has mostly been addressed and we're not anywhere close to the number of contributors that Grafana has..

@valeriupredoi
Copy link
Contributor

Fine by me - let's deploy this and see how to goes 🍻

Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sneaky - added some more hooks in pre-commit config - did you want to test my security level while reviewing? 😆 Thanks, bud - all fine for me!

rev: "v2.4.1"
hooks:
- id: codespell
- repo: https://github.com/python-jsonschema/check-jsonschema
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this do? Checks for baby shampoos? 😁

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It checks that the YAML files for GitHub Actions and CircleCI and the citation file follow the schema, i.e. don't have any keys that don't belong there or values of the wrong type.

@bouweandela
Copy link
Member Author

sneaky - added some more hooks in pre-commit config

It's what I meant with

add some schema checks too.

in the description at the top.

@bouweandela
Copy link
Member Author

Thanks for reviewing 🍻

@bouweandela bouweandela merged commit 5216a5b into main Jan 26, 2026
4 checks passed
@bouweandela bouweandela deleted the adopt-zizmor branch January 26, 2026 16:00
@valeriupredoi
Copy link
Contributor

all good, bud, just making a bit of fun at your expense on a dark and gloomy Monday - did we want to move away from arch x64 for OSX too? Or, in a separate PR better

@bouweandela
Copy link
Member Author

bouweandela commented Jan 26, 2026

No worries, yes, let's move away from the x64 OSX runner in a separate pr

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants