Skip to content

workflows: pin actions by commit SHA and narrow the token - #101

Merged
margani merged 1 commit into
mainfrom
fix/99-pin-actions
Nov 2, 2026
Merged

margani merged 1 commit into
mainfrom
fix/99-pin-actions

Conversation

@margani

@margani margani commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Closes #99.

What changed

  • Every action is pinned to a full commit SHA with a version comment: actions/checkout v4.4.0 (11d5960a…), softprops/action-gh-release v2.6.2 (3bb12739…). Both SHAs were resolved from each repository's own tag refs with gh api repos/<owner>/<repo>/git/matching-refs/tags/…; v4 and v2 currently point at these same commits.
  • Both workflows default to permissions: contents: read; only the release job gets contents: write.
  • The release checkout uses persist-credentials: false; run-tests and build-release do not need the token.

Why

The step that publishes release assets and the SHA256SUMS that ops-get trusts ran third-party code selected by a movable tag, with a write token.

Verification

  • Both files parse as YAML; grep uses: shows only 40-hex refs.
  • test.yml runs on this PR with the pinned checkout (CI).

Not verified

  • release.yml only runs on a tag push. It is exercised by the next release.

release.yml gave contents: write to the whole workflow and ran a third-party
action by a movable tag; that step publishes the SHA256SUMS ops-get trusts.
Pin every action to a full commit SHA, default both workflows to contents:
read, give write only to the release job, and do not persist the checkout
token while tests and the build run.

Closes #99
@margani
margani merged commit c363047 into main Nov 2, 2026
4 checks passed
@margani
margani deleted the fix/99-pin-actions branch November 2, 2026 19:46
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.

release workflow: pin actions by commit SHA and narrow the token

1 participant