Skip to content

Fix Zizmor warnings about GitHub Actions. - #861

Open
cpovirk wants to merge 4 commits into
mainfrom
pin-in-it
Open

Fix Zizmor warnings about GitHub Actions.#861
cpovirk wants to merge 4 commits into
mainfrom
pin-in-it

Conversation

@cpovirk

@cpovirk cpovirk commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

This addresses "unpinned action reference" warnings seen during #860.

I thought I would be all clever and automate it:

for F in $(grep -hoP 'uses: \K.*' .github/workflows/*.yml | sort -u); do R=${F%@*}; V=${F#*@}; git ls-remote https://github.com/${R}.git ${V} | awk '{ print $1 }'; done

But that's wrong for setup-gradle. I looked that one up manually (https://github.com/gradle/actions/releases/tag/v6.2.0 -> gradle/actions@3f131e8). Then:

perl -pi -e "s'actions/checkout@v7'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'; s'actions/deploy-pages@v5'actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128'; s'actions/setup-java@v5'actions/setup-java@e498d2a66a953492f322542257b22125c989b422'; s'actions/upload-pages-artifact@v5'actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9'; s'gradle/actions/setup-gradle@v6'gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92'" .github/workflows/*.yml

[edit: And then I had some typos in this second command. I have manually fixed the results and tried to update the regex here.]

I could instead have tried to install zizmor locally and run its fix mode.

cpovirk added 4 commits July 30, 2026 11:08
This addresses ["unpinned action reference"](https://docs.zizmor.sh/audits/#unpinned-uses) warnings [seen](https://github.com/jspecify/jspecify/actions/runs/30497738162/job/90730495179) during #860.

I thought I would be all clever and automate it:

```
for F in $(grep -hoP 'uses: \K.*' .github/workflows/*.yml | sort -u); do R=${F%@*}; V=${F#*@}; git ls-remote https://github.com/${R}.git ${V} | awk '{ print $1 }'; done
```

But that's wrong for setup-gradle. I looked that one up manually (https://github.com/gradle/actions/releases/tag/v6.2.0 -> gradle/actions@3f131e8). Then:

```
perl -pi -e "s'actions/checkout@v7'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'; s'actions/deploy-pages@v5'actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128'; s'actions/setup-java@v5'actions/setup-java@e498d2a66a953492f322542257b22125c989b422/'; s'actions/upload-pages-artifact@v5'actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9'; s'gradle/actions/setup-gradle@v6'gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92/'" .github/workflows/*.yml
```

I could instead have tried to install zizmor locally and run [its fix mode](https://docs.zizmor.sh/usage/#auto-fixing-results).
@cpovirk cpovirk changed the title Pin Actions to specific hashes. Fix Zizmor warnings about GitHub Actions. Jul 30, 2026
copybara-service Bot pushed a commit to google/escapevelocity that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/guava-beta-checker that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/compile-testing that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/jimfs that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/flogger that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/caliper that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/truth that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/auto that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/guava that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/guava-beta-checker that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/jimfs that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/compile-testing that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/truth that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/escapevelocity that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/caliper that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/auto that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/flogger that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/guava that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/escapevelocity that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/jimfs that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/auto that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/caliper that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/compile-testing that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/guava-beta-checker that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/truth that referenced this pull request Jul 30, 2026
copybara-service Bot pushed a commit to google/guava that referenced this pull request Jul 30, 2026
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.

1 participant