Skip to content

CI: Harden GHA configuration #627

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 4 commits into
base: develop
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

@tacaswell
Copy link
Member Author

I apparently forgot to pull main before doing this, working on it.

This eliminates the possibility of a tag being changed under
us.
@molinav
Copy link
Member

molinav commented Jul 19, 2025

Thanks for the contribution, @tacaswell! I was looking at the workflow attempt for this PR:
https://github.com/matplotlib/basemap/actions/runs/16377453139

The workflow could not start with the following error message:

Invalid workflow file: .github/workflows/build.yml#L2](https://github.com/matplotlib/basemap/actions/runs/16377453139/workflow)
The workflow is not valid. .github/workflows/build.yml (Line: 2, Col: 3): Unexpected value 'content'

It refers to the first code block added at the top of .github/workflows/build.yml:

permissions:
content: read

Something in this code block seems to need some syntax change (I do not have the knowledge for this global use of permissions).

@molinav
Copy link
Member

molinav commented Jul 19, 2025

I was looking briefly at other similar merged PRs in the matplotlib ecosystem:
https://github.com/matplotlib/matplotview/pull/8/files
https://github.com/matplotlib/mpl-gui/pull/22/files

It seems to me it is just a typo, so it should be contents instead of content. Is this correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants