Skip to content

ci: pin GitHub Actions to commit SHAs - #1314

Open
chopmob-cloud wants to merge 1 commit into
a2aproject:mainfrom
chopmob-cloud:ci/pin-actions-sha
Open

chopmob-cloud wants to merge 1 commit into
a2aproject:mainfrom
chopmob-cloud:ci/pin-actions-sha

Conversation

@chopmob-cloud

Copy link
Copy Markdown
Contributor

Pins the GitHub Actions in .github/workflows to full-length commit SHAs with # vX version comments, bringing this repo in line with the sibling repo a2a-go, which is already fully pinned.

Why

A mutable tag like @v7 can be moved to new code after review, so a compromised or hijacked action tag would run with this workflow's permissions. Pinning to a commit SHA is the OpenSSF Scorecard "Pinned-Dependencies" control and the GitHub-recommended practice. This repo already runs Dependabot for the github-actions ecosystem, so Dependabot keeps the SHA pins current (it bumps the SHA and the # vX comment together).

What

  • Pins every non-local uses: across 10 workflow files to its exact commit SHA, keeping a # vX version comment. Same versions, no upgrades or downgrades.
  • Generated with pinact; each pinned SHA was verified to resolve to the version in its comment via the GitHub API.
  • Ref-pinning only: no job, step, trigger, or permission changed, so there is no functional change. A few already-pinned entries also had their # vX comment expanded to the exact version (same SHA).

@chopmob-cloud
chopmob-cloud requested a review from a team as a code owner October 5, 2026 06:03
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

No coverage changes.

Generated by coverage-comment.yml

@chopmob-cloud
chopmob-cloud force-pushed the ci/pin-actions-sha branch 2 times, most recently from ade341e to fbd96fd Compare October 28, 2026 14:02
@chopmob-cloud

Copy link
Copy Markdown
Contributor Author

Rebased onto current main — was 18 commits behind, now green

Rebased ci/pin-actions-sha onto main (43d1eff1). The rebase applied cleanly and the branch is now a single commit ahead, with the same intent: every uses: pinned from a floating tag to a commit SHA.

No upstream pins were clobbered — upstream had not touched these uses: lines in the interim, so the diff is still exactly the tag→SHA conversion across 10 workflow files, and no unpinned uses: remains:

grep -rnE "uses:\s+[a-zA-Z0-9._/-]+@(v[0-9]|main|master)" .github/workflows/   # empty

Spot-verified three pins against the tag they claim:

action pinned SHA resolves to
actions/checkout@v7.0.1 3d3c42e5aac5ba805825da76410c181273ba90b1
astral-sh/setup-uv@v7.6.0 37802adc94f370d6bfd71619e3f0bf239e1f3b78
actions/cache@v6.1.0 55cc8345863c7cc4c66a329aec7e433d2d1c52a9

Checks, per this repo's docs/ai/mandatory_checks.md

  • uv run ruff check → All checks passed.
  • uv run pytest → 2482 passed, 203 skipped, 4 xfailed (--ignore=tests/integration/cross_version).
  • uv run ty check → 3 diagnostics, identical on pristine main (verified by checking out upstream/main and re-running), so pre-existing and unrelated.
  • The 4 push_notifications errors and the cross_version failures also reproduce on pristine main — they are Windows subprocess/shell environment issues (TypeError: stat: path should be ... not NoneType, shell not found: neither %ComSpec% nor %SystemRoot% is set), not branch regressions. CI runs these on Linux.

All 17 checks now pass, so this is ready for review. Head is fbd96fd9204d8523199caa0000a49120604eaf41.

@ishymko
ishymko requested review from a team and removed request for a team November 12, 2026 10:27
Pin the GitHub Actions in .github/workflows to full-length commit SHAs
with version comments. A mutable tag can be re-pointed after review, so
pinning to a commit SHA is the OpenSSF Scorecard Pinned-Dependencies
control. Ref-pinning only, same versions, no functional change. Generated
with pinact; each SHA verified to resolve to its version tag.

Signed-off-by: AlgoVoi <chopmob@gmail.com>
@chopmob-cloud

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and resolved the conflicts.

What conflicted. acts.yaml and acts-nightly.yaml — main has since removed the "Cache launcher peer-SDK checkouts + build outputs" step, so the PR's hunk that re-added it (pinned) no longer applies. I dropped that hunk and kept main's structure rather than resurrecting a step that no longer exists upstream.

What I did instead. Those two files still carried unpinned action refs on main, so I pinned them in place — 6 in acts.yaml, 7 in acts-nightly.yaml — using the same SHAs the rest of this PR already uses, so the PR stays internally consistent.

Verification. Every uses: in .github/workflows is now pinned to a 40-character commit SHA: 58 total, 0 unpinned. All workflow YAML parses. The diff is still purely uses: substitutions — 10 files, +38/−38, no other change.

One thing worth your call. Two upstream tags have moved since the original pins in this PR: actions/upload-artifact@v7 now resolves to cf430e03… (this PR pins 043fb46d…, v7.0.1) and softprops/action-gh-release@v3 now resolves to 8a0cd651… (this PR pins efb35369…, v3.0.3). I left the existing pins untouched to avoid changing more than the rebase required — say the word and I will bump those (and any other drifted pins) in a follow-up commit on this branch.

@chopmob-cloud

Copy link
Copy Markdown
Contributor Author

Correction to my earlier comment on this PR — I need to withdraw the "two tags have moved" remark. It was wrong.

I had compared the pins against the moving major tags (upload-artifact@v7, action-gh-release@v3) instead of the exact versions this PR pins. Checked properly against the exact tags:

  • actions/upload-artifact@v7.0.1 → 043fb46d1a93… — exactly what this PR pins. Correct.
  • softprops/action-gh-release@v3.0.3 → efb35369e0ad… — exactly what this PR pins. Correct.

So those two pins are accurate, not stale. Apologies for the noise.

While auditing, I did find three refs that are behind their major tag, but all three are pre-existing on main and not introduced by this PR, so I have deliberately left them alone to keep this change scoped to the rebase:

Ref Pinned on main Current tag resolves to
actions/setup-python@v6 5fda3b95a4… ece7cb06ca…
actions/stale@v10 4391f3da66… 1e223db275…
googleapis/release-please-action@v4 45996ed1f6… 5c625bfb5d…

There is also a pre-existing mislabel worth fixing separately: several workflows pin actions/checkout@3d3c42e5… (which is v7/v7.0.1 — v6 is d23441a48e…) but carry a # v6 comment. The SHA is fine; the comment is wrong. Happy to raise either of these as a follow-up PR rather than widening this one.

This branch has not been deployed

No deployments
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