Skip to content

fix(ci): make the pinned-actions linter a real gate, and check SHAs exist - #46

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/linter-real-gate
Jul 28, 2026
Merged

fix(ci): make the pinned-actions linter a real gate, and check SHAs exist#46
hyperpolymath merged 1 commit into
mainfrom
fix/linter-real-gate

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

The step that enforces SHA pinning could never fail.

workflow-linter.yml's Check pinned actions set errors=0, only echoed a WARNING (never incrementing), and — unlike the two steps above it — ended with no exit $errors. A declared policy with no enforcement. It also globbed only .github/workflows, so the phantom pin in examples/oikosbot-ci.yml (fixed in #44) was structurally invisible.

Now it:

  • increments and exits — it can fail;
  • scans examples/ too;
  • flags tag/branch refs;
  • probes each SHA against the GitHub API and fails if it is not a real commit.

That last check is the point. A phantom SHA isn't an ordinary red: the ref resolves to nothing, the job dies in Set up job, and no check run is produced at all — invisible to gh pr checks, indistinguishable from green. Three distinct phantom codeql-action SHAs were circulating across this repo and metadatastician-governance.

Verified both directions (a gate I cannot prove will fail is the exact thing being fixed here):

  • clean on this repo → exit 0;
  • falsifier fixture with one tag ref + the real phantom 39a73d65…exit 2, both named, the phantom caught inside examples/.

🤖 Generated with Claude Code

…xist

The 'Check pinned actions' step could not fail on any input: it set
errors=0, only echoed a WARNING (never incrementing), and — unlike the two
steps above it — ended without `exit $errors`. A policy declared but not
enforced. It also globbed only .github/workflows, so the phantom pin in
examples/oikosbot-ci.yml (#44) was structurally invisible to it.

Now the step:
  - increments and exits, so it can actually fail;
  - scans examples/ as well as .github/workflows/;
  - flags tag/branch refs (shape check, as before, but enforced);
  - probes each 40-hex SHA against the GitHub API and fails if it is not a
    real commit.

That last check is the one that matters. A phantom SHA is not a normal
red: the ref resolves to nothing, the job dies in 'Set up job', and NO
check run is produced — so it is invisible to `gh pr checks` and reads as
green. Three distinct phantom codeql-action SHAs were in circulation
across this repo and metadatastician-governance.

Verified both directions: clean on this repo (exit 0), and a falsifier
fixture containing one tag ref plus the real phantom SHA
39a73d65469e0144129775918a2032174234c279 exits 2 with both named.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

Note

Automatic reviews are paused because your trial's included automatic processing has been used for this period. Upgrade now, or comment "Gitar review" to run a review anytime.
Learn more

Code Review ✅ Approved

Converts the workflow pinned-actions linter into a blocking CI gate that scans examples and validates every SHA against the GitHub API. No issues found.

Auto-approved and auto-merge armed: No blocking issues found.
Please see Auto-approve Docs for details on setting custom approval criteria. — merges when pipeline and required approvals pass.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@gitar-bot

gitar-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

⚠️ Gitar auto-approved this PR but could not enable auto-merge: auto-merge is disabled for this repository — enable "Allow auto-merge" in the repository settings.

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gitar has auto-approved this PR and enabled auto-merge (configure)

@gitar-bot gitar-bot Bot added the gitar-approved Added by Gitar label Jul 28, 2026
@hyperpolymath
hyperpolymath merged commit dfccb89 into main Jul 28, 2026
27 checks passed
@hyperpolymath
hyperpolymath deleted the fix/linter-real-gate branch July 28, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gitar-approved Added by Gitar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant