Skip to content

fix: pin nested actions by commit SHA - #155

Merged
ivanmilevtues merged 1 commit into
CodeBoarding:mainfrom
Stephan202:fix/pin-nested-actions
Oct 25, 2026
Merged

ivanmilevtues merged 1 commit into
CodeBoarding:mainfrom
Stephan202:fix/pin-nested-actions

Conversation

@Stephan202

Copy link
Copy Markdown
Contributor

Problem

action.yml uses five third-party actions by mutable tag or branch. This is not
compatible with GitHub's "Require actions to be pinned to a full-length commit
SHA" policy, which is also enforced on the actions that a composite action uses:
adopters with that policy enabled cannot use this action, even if they pin the
action itself. Pinning by commit SHA is also a general best practice, as a
mutable tag can be moved to different code after it has been reviewed.

Change

  • Pin all 12 uses: references in action.yml to a full commit SHA, with the
    release as a trailing comment.
  • Add tests/test_action_pinning.py, which fails if a non-local uses: in
    action.yml is not pinned to a 40-character SHA.

Each SHA is the commit that the current moving ref resolves to (checked on
2026-10-25), so the code that runs is unchanged:

Action Was Now
actions/checkout v4 11d5960a326750d5838078e36cf38b85af677262 (v4.4.0)
actions/setup-java v5 b6effb05e454b25005698d916606bdc6ffcbf961 (v5.7.0)
actions/setup-python v5 a26af69be951a213d495a4c3e4e4022e16d87065 (v5.6.0)
actions/upload-artifact v4 ea165f8d65b6e75b540449e92b4886f43607fa02 (v4.6.2)
marocchino/sticky-pull-request-comment v2 (branch) 773744901bac0e8cbb5a0dc842800d45e9b2b405 (v2.9.4)

Verification

The new test fails on main and passes with this change. The existing suite
passes (python -m unittest discover -s tests: 259 tests, 7 skipped).

Notes

  • Only action.yml is changed, as it is the file adopters execute. The
    repository's own workflows also use tag references; I can pin those in a
    follow-up.
  • SHA pins do not update themselves; Dependabot or Renovate can maintain them.
    I have not added either here.

AI disclosure

This change was written using Claude Sonnet 5.5 with high effort.

Repositories can require actions to be pinned to a full-length commit
SHA. GitHub enforces that on the actions used by a composite action as
well, so the tag references in `action.yml` made the action fail at
startup, with a bare `startup_failure`, for every adopter with that
policy enabled.

Pin all five actions that `action.yml` uses to the commit their current
moving tag or branch resolves to, with the exact release as a comment.
This does not change which code runs. Add a test that rejects any
non-local `uses:` in `action.yml` that is not pinned to a full SHA.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T14:09:01.471058Z bff144d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Svilen-Stefanov Svilen-Stefanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @Stephan202! I double checked all the SHAs against the upstream tags and they all match, so nothing changes at runtime 👍 The pinning test is a good guard too, especially the check that the regex matches anything at all.

I'll add a dependabot config to get notified when things change and keep them up to date.

@ivanmilevtues
ivanmilevtues merged commit 3d52056 into CodeBoarding:main Oct 25, 2026
5 checks passed
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.

3 participants