Skip to content

CI: Harden GHA configuration #308

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tacaswell
Copy link
Member

Apply recommended hardening steps including:

  • pinning to a SHA any actions used
  • not persisting the read token on checkout
  • setting the default permissions
  • adding a depandabot file for GHA

This eliminates the possibility of a tag being changed under
us.
This eliminates the possibility of a tag being changed under
us.
May include:

- Avoids risky string interpolation.
- Prevents checkout premissions from leaking
Reduces risk of arbitrary code is run by attacker.
@tacaswell
Copy link
Member Author

See matplotlib/matplotlib#30045 but precommit.ci has been disabled at the org level, not sure what else needs to be done to get rid of the check.

@samcunliffe
Copy link
Collaborator

precommit.ci has been disabled at the org level, not sure what else needs to be done to get rid of the check

Looks like that worked! pre-commit.ci is one of our required checks, and it hasn't run. So @dstansby (or anyone else with access to repo settings) we just need to switch to requiring the GHA "precommit" added here.

Screenshot 2025-07-19 at 11 11 07

👍 Dependabot will send update PRs updating the SHAs.

@samcunliffe samcunliffe added Maintenance dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code labels Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code Maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants