Skip to content

Pin actions/cache to a commit SHA - #68

Open
nohwnd wants to merge 1 commit into
potatoqualitee:mainfrom
nohwnd:pin-actions-cache
Open

Pin actions/cache to a commit SHA#68
nohwnd wants to merge 1 commit into
potatoqualitee:mainfrom
nohwnd:pin-actions-cache

Conversation

@nohwnd

@nohwndnohwnd commented Sep 5, 2026

Copy link
Copy Markdown

GitHub's "Require actions to be pinned to a full-length commit SHA" policy (Settings > Actions > General) applies to actions referenced inside a composite action, not only to the ones in the consumer's own workflow. So a repository that turns the policy on and uses psmodulecache fails at Set up job, before anything runs:

Error: The action actions/cache@v5.0.5 is not allowed in <repo> because all actions
must be pinned to a full-length commit SHA.

We ran into this in pester/Pester. We have pinned every action in our own workflows, so this nested reference is the one thing left that keeps us from turning the policy on. There is no way to fix it from the consumer side, which is why I am sending it here.

Same version, no behaviour change: 27d5ce7f107fe9357f9df03efb73ab90386fccae is the commit v5.0.5 points at. Dependabot updates the SHA and the trailing version comment together, so it does not become manual work.

Happy to do the same for the workflows under .github/ if you want. I kept this to action.yml since that is the part consumers execute.

🤖

Same version, v5.0.5, just referenced by SHA so the action works in repositories
that require SHA pinning.
🤖
Sign up for freeto 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

@nohwnd