Skip to content

ci: pin the remaining GitHub Actions by commit SHA, and refuse a tag - #2474

Merged
cyberlife-coder merged 2 commits into
developfrom
ci/pin-remaining-actions
Oct 25, 2026
Merged

cyberlife-coder merged 2 commits into
developfrom
ci/pin-remaining-actions

Conversation

@cyberlife-coder

@cyberlife-coder cyberlife-coder commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Description

Twenty uses: references were still pinned by tag only, although every other reference in the tree names a 40-hex commit with the version in a comment. A tag is a pointer its owner can move under a job that holds the repository's secrets (the Docker publish and release workflows push images and packages). Each reference now names the commit its tag resolved to, with the matching vX.Y.Z in the comment.

No version is bumped. Where a moving major tag had advanced past the pin the rest of the tree carries (upload-artifact@v7 is v7.0.2 today, ci.yml pins v7.0.1; download-artifact@v8 is v8.0.2, ci.yml pins v8.0.1), the pin follows the tag, so behaviour is what the job ran until now. Dependabot's github-actions ecosystem (already in .github/dependabot.yml) moves SHA and comment together from here.

A guard was missing: scripts/tests/test_workflow_actions_pinned.py fails on any uses: that is not a local reference, a lower-case 40-hex commit, or a docker:// image pinned by @sha256: digest. It is picked up by unittest discover in the Gate Contracts job, which ci.yml calls, so it reaches CI Success with no new wiring. It does not require the trailing version comment (that is what Dependabot reads, not what makes the pin safe); awalsh128/cache-apt-pkgs-action in propagation-guard.yml and contributor-assistant/github-action in cla.yml are SHA-pinned without one, left as they are.

References changed (every changed line touches only the uses: ref and its comment)

git ls-remote https://github.com/<repo>.git refs/tags/<tag> 'refs/tags/<tag>^{}': all ten tags are lightweight (no peeled ^{} line), and v<major> and vX.Y.Z list the same commit.

Old ref Commit Version Occurrences
actions/checkout@v7 3d3c42e5aac5ba805825da76410c181273ba90b1 v7.0.1 docker-publish 1, release 1, release-mcpb 2, release-memory 1
actions/cache@v6 55cc8345863c7cc4c66a329aec7e433d2d1c52a9 v6.1.0 ci.yml 3
actions/setup-python@v7 6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 v7.1.0 gate-contracts 2
actions/setup-node@v7.1.0 949feb2413d6458794dcd2491c4babbbce0c15c1 v7.1.0 gate-contracts 1
actions/upload-artifact@v7 cf430e030ddbb5b0abf93d22962f4752f3646cd9 v7.0.2 docker-publish 1
actions/download-artifact@v8 9000827ccba6bdab643e8b6fd33ac0654aef8333 v8.0.2 docker-publish 1
docker/setup-buildx-action@v4 f87e5991a6d7451dcb8d9637bfbc97413f497069 v4.4.1 docker-publish 2
docker/login-action@v4 81c6f93d4bc991e510b342a00b419b3bb4efc5c6 v4.7.0 docker-publish 2
docker/metadata-action@v6 dc802804100637a589fabce1cb79ff13a1411302 v6.2.0 docker-publish 2
docker/build-push-action@v7 c3c9e263c25d99ce0380d002d59b67737d91b0dc v7.4.0 docker-publish 1

Type of Change

  • 🔧 Refactoring (no functional changes)

How Has This Been Tested?

  • Unit tests: the new suite (22 tests) was run first against the unpinned tree and failed on all twenty references, then passes; it also exercises its refusals on synthetic lines (tag, branch, short or over-long SHA, upper-case SHA, quoted tag, remote reusable workflow at a tag, docker:// by tag, a SHA hidden in a trailing comment) and its acceptances (local actions and workflows, quoted SHA, digest-pinned image, commented-out lines).
  • python -m unittest discover -s scripts/tests -p "test_*.py" -t .: 1281 tests OK (14 skipped); every workflow parses with yaml.safe_load.
  • Version-sync, feature-claims, mcp-doc-contract, skill-private-references, doc-contract, doc-freshness (5 guards) and AI-attribution checks pass. check-promise-contract.py exits 1 here and on a clean origin/develop alike.
  • Manual testing

Pull-request coverage, stated plainly: docker-publish.yml, release.yml, release-mcpb.yml and release-memory.yml do not run on pull requests, so their pins are verified statically only (the table above and the ls-remote evidence). The ci.yml and gate-contracts.yml pins run in this PR's checks.

Test Configuration:

  • OS: Linux
  • Rust version: not applicable (no Rust change)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Twenty `uses:` references were still pinned by tag only: docker-publish.yml
(ten), ci.yml (`actions/cache@v6` x3), gate-contracts.yml (setup-python x2,
setup-node), release.yml, release-mcpb.yml (x2), release-memory.yml, and
`actions/checkout@v7`. A tag is a pointer its owner can move under a job that
holds the repository's secrets; every other reference in the tree already
names a 40-hex commit with the version in a comment.

Each reference now names the commit its tag resolved to when this change was
written, checked with git ls-remote (every tag involved is lightweight, so
there is no peeled commit to take). No version is bumped: where a moving major
tag had advanced past the pin the rest of the tree carries, the pin follows
the tag, and the comment names the exact release found at that commit.
Dependabot's github-actions ecosystem keeps moving SHA and comment together.

scripts/tests/test_workflow_actions_pinned.py is the guard that was missing.
It is discovered by the Gate Contracts job, so a tag, a branch or a short SHA
in a workflow fails CI Success, and its refusals are exercised on synthetic
lines as well as on the real tree.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@cyberlife-coder
cyberlife-coder merged commit 9c34543 into develop Oct 25, 2026
64 checks passed
@cyberlife-coder
cyberlife-coder deleted the ci/pin-remaining-actions branch October 25, 2026 08:44
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