Skip to content

ci: pin checkout actions to immutable commits - #150

Merged
kkroo merged 4 commits into
masterfrom
ci/pin-checkout-actions
Nov 2, 2026
Merged

kkroo merged 4 commits into
masterfrom
ci/pin-checkout-actions

Conversation

@kkroo

@kkroo kkroo commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Replace moving or tag-based actions/checkout references with immutable commit SHAs while preserving workflow behavior.

Topotest host-prep: a new step, "Enable -proposed if the running kernel's modules need it", runs just before "Run topotests" and enables <codename>-proposed only when linux-modules-$(uname -r) is in no enabled pocket. BLO-50264 rolled every Ubuntu runner host to 6.8.0-149-generic (CVE-2026-98432) while that kernel is still only in noble-proposed, so every arc-e2e Test leg failed before a test ran with E: Unable to locate package linux-modules-6.8.0-149-generic (run 41348239649, 4/4 shards). The -proposed Release is NotAutomatic, so every package that also exists in another pocket still comes from that pocket. A kernel with no package in any pocket (Talos, BLO-43500) still fails the step.

It is a separate step, not lines in "Run topotests", because that script uses expression syntax: GitHub parses all of it as one expression, capped at 21,000 characters, and it is at 20,467. The first version added the lines inline (21,183 characters), and GitHub rejected the whole workflow: push run 41359389406 failed at startup with no jobs, and no pull_request run was created. A comment above that run: block now records the cap.

Validation

  • git diff --check
  • Verified replacement SHAs against official checkout repository tags
  • Ran the new step's shell and then the unchanged "Run topotests" apt section in ubuntu:24.04 on a 6.8.0-149-generic host: exit 0; both module packages from noble-proposed; kmod and python3-xmltodict from noble-updates
  • "Run topotests" script length is 20,467 (unchanged from main); the new step has no expressions
  • actionlint exits 0; .github/scripts pytest: 594 passed
  • github-ci push and pull_request runs at 570d6a7 are named and have jobs

@allyblockcast allyblockcast Bot 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.

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex (applied directly; no nested CLI in the k8s runtime).
Reviewed head: 197fb7b

Critical Issues (0)

Important Issues (1)

  • [gstack/review] .github/workflows/review-gate.yml:133 (and all 22 replaced refs across the 13 files): the pinned SHA 08c6903cd8c0fde910a37f88322edcfb5dd907a8 is v5.0.0, but actions/checkout@v5 currently resolves to v5.1.0 (fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09; verified via git/ref/tags/v5 and git/ref/tags/v5.1.0). So the PR does not preserve behavior, despite what its description says. It rolls every checkout back two releases and drops:
    • v5.1.0: the backported safer pull_request_target default (allow-unsafe-pr-checkout, actions/checkout#2501), which refuses to check out PR-head code in a privileged pull_request_target context unless you opt in. This repo has 9 pull_request_target workflows, and behind-base.yml checks out github.event.pull_request.head.sha with pull-requests: write. That job is dormant today (if: github.repository == 'frrouting/frr', so every recent run was skipped), but this pin removes the guard for it and for any future workflow in this repo. That is the opposite of what a supply-chain hardening PR should do.
    • v5.0.1: "Port v6 cleanup to v5" (actions/checkout#2301).
    • Recommendation: pin to fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 (v5.1.0), i.e. the commit @v5 runs today. Behavior then actually stays the same.

Suggestions (2)

  • [pr-review-toolkit/comments] Add a version comment, uses: actions/checkout@<sha> # v5.1.0. A bare SHA is unreviewable: this review needed three API calls to find out which release it was, and that is how the downgrade above went unnoticed. The repo has no dependabot.yml/renovate config, so nothing will bump these pins later. Consider adding a github-actions Dependabot ecosystem so they don't fossilize.
  • [native-codex] Scope note: other third-party actions are still on mutable tags, e.g. dorny/paths-filter@v4 (github-ci.yml:175), actions-ecosystem/action-add-labels@v1 and action-regex-match@v2. These are a larger supply-chain surface than first-party actions/checkout. Fine as a follow-up; just don't let this PR read as "actions are pinned".

Strengths

  • The change is purely mechanical, and every actions/checkout ref in .github/ was replaced. A grep at head finds no remaining tag-based checkout refs.
  • The SHA really is an official actions/checkout commit (not a fork or an orphan), so the pin is not itself a supply-chain risk. It is just the wrong release.

Recommended Action

  1. Address Important issues this cycle.
  2. Consider Suggestions opportunistically.

08c6903c is v5.0.0, two releases behind what `@v5` resolves to, so the
pin rolled checkout back and dropped v5.1.0's safer pull_request_target
default (actions/checkout#2501) and the v5.0.1 cleanup port. Pin all 22
refs to fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 (refs/tags/v5 and
refs/tags/v5.1.0) so workflow behavior is unchanged.
@kkroo

kkroo commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

@ally please review at head 5a9c6b8.

(Omar's drive session, delegated. This is not Omar.)

This fixes your Important finding on 197fb7b. All 22 checkout refs now pin fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09, the commit that refs/tags/v5 and refs/tags/v5.1.0 both point to today. Behavior is unchanged and the v5.1.0 pull_request_target default is kept.

allyblockcast[bot]
allyblockcast Bot previously approved these changes Nov 1, 2026

@allyblockcast allyblockcast Bot 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.

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex (applied directly; no nested CLI in the k8s runtime).
Reviewed head: 5a9c6b8

Looks good.

Prior Findings Dispositioned (1)

  • prior:197fb7b important 1 — fixed — .github/workflows/review-gate.yml:133 — all 22 refs now pin fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09. Re-verified today that this is the commit actions/checkout tags v5 and v5.1.0 both resolve to (git/ref/tags/v5, git/ref/tags/v5.1.0). So the pin keeps current behavior, including the v5.1.0 safer pull_request_target default.

Critical Issues (0)

Important Issues (0)

Suggestions (1)

  • [pr-review-toolkit/comments] .github/workflows/review-gate.yml:133 (and the other 21 refs): add a trailing # v5.1.0 comment so a reader can see which release the bare SHA is. Nothing bumps these pins automatically (there's no Dependabot github-actions config), so a follow-up adding one would keep them from going stale. Other third-party actions (e.g. dorny/paths-filter@v4) are still on mutable tags. That's fine as a follow-up.

Strengths

  • Purely mechanical. I scanned every workflow file at this head and found no remaining tag-based actions/checkout refs.
  • The pinned SHA is the official upstream commit @v5 runs today, so the change matches the PR description: behavior is preserved.

Recommended Action

  1. No blocking changes requested.
  2. Merge once the remaining required CI checks finish green.

…cket has them

BLO-50264 rolled every Ubuntu runner host to 6.8.0-149-generic for
CVE-2026-98432 while that kernel is still only in noble-proposed.
Topotest host-prep installs linux-modules-$(uname -r), so every Test
leg on arc-e2e now fails before a test runs:
"E: Unable to locate package linux-modules-6.8.0-149-generic".

Enable <codename>-proposed only when the running kernel's modules are
in no enabled pocket. Its Release is NotAutomatic (priority 100), so
kmod, python3-xmltodict and linux-modules-extra-azure still come from
-updates; only the module packages that exist nowhere else come from
-proposed. A kernel with no package in any pocket (Talos, BLO-43500)
still fails the step as before.

Checked in ubuntu:24.04 on a 6.8.0-149-generic host: the step exits 0,
both module packages resolve from noble-proposed and the other three
from noble-updates.
allyblockcast[bot]
allyblockcast Bot previously approved these changes Nov 1, 2026

@allyblockcast allyblockcast Bot 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.

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex (applied directly; no nested CLI in the k8s runtime).
Reviewed head: cd15769

Looks good. The new commit (cd15769c1, the kernel modules -proposed fallback) is correct and narrowly scoped. The checkout pins are unchanged since the last review.

Prior Findings Dispositioned (1)

  • prior:197fb7b important 1 — fixed — .github/workflows/review-gate.yml:133 — all 22 actions/checkout refs pin fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09. I re-checked today that both actions/checkout tags v5 and v5.1.0 resolve to this commit, so the v5.1.0 safer pull_request_target default is kept. (Re-stated here because the review that previously retired this finding was dismissed.)

Critical Issues (0)

Important Issues (0)

Suggestions (2)

  • [gstack/review] .github/workflows/github-ci.yml:1038 — the -proposed kernel-modules fallback (BLO-50264) has nothing to do with this PR's title, "pin checkout actions to immutable commits". The logic is sound:

    • The probe on linux-modules-$(uname -r) only enables -proposed when no other pocket has the package.
    • NotAutomatic keeps kmod, python3-xmltodict and linux-modules-extra-azure on -updates.
    • A kernel that has no package anywhere still fails the install step the same way it did before.

    Consider retitling the PR, or splitting the commit out, so the CVE-driven CI change is discoverable in history.

  • [pr-review-toolkit/comments] .github/workflows/review-gate.yml:133 (and the other 21 refs): carried forward from earlier reviews.

    • Add a trailing # v5.1.0 to each pin. Nothing bumps these SHAs automatically; the repo has no Dependabot github-actions config.
    • Other third-party actions are still on mutable tags, e.g. dorny/paths-filter@v4. Fine as a follow-up.

Strengths

  • The fallback is gated on a precise probe and uses the same retry idiom as the surrounding code. The commit message records an empirical check on a real 6.8.0-149 host.
  • I scanned every workflow at this head: no tag-based actions/checkout refs remain.

Recommended Action

  1. No blocking changes requested.
  2. Merge once the remaining required CI checks finish green.

The "Run topotests" script uses expression syntax, so GitHub parses the
whole script as one expression, and expressions are capped at 21,000
characters. It was at 20,467; the fallback added in the previous commit
took it to 21,183, and GitHub rejected the entire workflow: the push run
41359389406 failed at startup with no jobs, no pull_request run was
created, and the PR rollup still read green. actionlint does not check
this limit.

Move the fallback into its own step just before "Run topotests". Its
script has no expressions, and the topotests script is back to its
original 20,467 characters. A comment above that run: block records
the cap.

Checked in ubuntu:24.04 on a 6.8.0-149-generic host: the new step adds
noble-proposed, the unchanged install then takes both module packages
from noble-proposed, and kmod and python3-xmltodict from noble-updates.
actionlint exits 0; .github/scripts pytest 594 passed.

@allyblockcast allyblockcast Bot 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.

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex (applied directly; no nested CLI in the k8s runtime).
Reviewed head: 570d6a7

Looks good. The new commit (570d6a72f) moves the -proposed kernel-modules fallback out of the "Run topotests" script and into its own step. That keeps the script under GitHub's 21,000-character expression cap. Confirmed: github-ci is now accepted and queued at this head, not rejected.

Prior Findings Dispositioned (1)

  • prior:197fb7b important 1 — fixed — .github/workflows/review-gate.yml:133 — all 22 actions/checkout refs pin fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09. I re-checked today that both git/ref/tags/v5 and git/ref/tags/v5.1.0 resolve to this commit, so the safer v5.1.0 pull_request_target default is kept. (Re-stated because the earlier reviews that retired this finding were dismissed.)

Critical Issues (0)

Important Issues (0)

Suggestions (2)

  • [gstack/review] .github/workflows/github-ci.yml:1019 — the new step runs one unretried apt-get update -y || true. The old inline version probed only after the retried update loop.
    • If the mirror fails transiently, apt-cache show can miss the package and -proposed gets enabled when it isn't needed.
    • This is harmless: the NotAutomatic pin keeps every package on its normal pocket, and the topotests step re-runs its retried update.
    • Reusing the 3-try loop here would make the probe deterministic.
  • [pr-review-toolkit/comments] .github/workflows/review-gate.yml:133 (and the other 21 refs): carried forward from earlier reviews.
    • Add a trailing # v5.1.0 comment so readers can see which release each SHA is.
    • Consider adding a Dependabot github-actions ecosystem so the pins don't go stale.
    • The kernel-modules fallback is unrelated to the PR title; consider retitling the PR or splitting that commit out.

Strengths

  • The new comment on "Run topotests" records the 21,000-character expression cap and its failure mode: the whole workflow is rejected with no jobs and no error check. It also tells the next editor where host-prep belongs.
  • The step order is correct. kernel-proposed.list is written before "Run topotests" runs its retried apt-get update and install, so the install sees the new pocket.

Recommended Action

  1. No blocking changes requested.
  2. Merge once the remaining required CI checks finish green.

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