Skip to content

fix: pin required-workflow reusable ref to a SHA (unbreak org-wide Security Suite)#88

Merged
dkastl merged 1 commit into
mainfrom
fix/required-workflow-pin-reusable-ref
Jul 6, 2026
Merged

fix: pin required-workflow reusable ref to a SHA (unbreak org-wide Security Suite)#88
dkastl merged 1 commit into
mainfrom
fix/required-workflow-pin-reusable-ref

Conversation

@dkastl

@dkastl dkastl commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Regression (org-wide, urgent)

Since #86 / v1.27.0, the Security Suite required check never runs on consumer PRs — it hangs at "Expected — waiting for workflow to run" forever and blocks merge (e.g. geolonia-infra-cdk#151).

Root cause

#86 changed the org required workflow security-suite.yml to reference its reusable via a floating @v1 (was a SHA pin). The ruleset "require workflows" injector does not run a required workflow whose own reusable is a moving tag — it silently produces no run at all (no check-run, not even a failure), so the required check stays "Expected".

Evidence it's exactly this one ref:

  • The only diff between the last-working release (v1.26.0, SHA-pinned) and current @v1 (v1.28.0, floating) is this single uses: line.
  • On infra-cdk#151's head there is no Security Suite run — only ci.yml.
  • Every consumer's last suite run was before @v1 moved to v1.27.0.
  • fix: drive geolonia/.github zizmor findings to zero (harden shared workflows) #87's own suite CI ran green with the full @v1 chain as a normal workflow — proving the inner reusable-security-suite → sub-reusables@v1 (REF3) resolves fine at runtime. Only the top-level required-workflow reference (REF2) is affected.

Fix (surgical, one line)

SHA-pin only the required workflow's reusable ref:

uses: …/reusable-security-suite.yml@82a98a9…  # v1.28.0   (was @v1)
  • Inner scanner refs (reusable-security-suite → sub-reusables) stay @v1 — they float fine at runtime.
  • workflow-templates/security-suite.yml stays @v1 — adopted as a normal workflow, moving tags work there.

Tradeoff

The treadmill returns only one level: bump this SHA when reusable-security-suite.yml itself changes. Sub-reusable changes (the frequent ones) still propagate via @v1 with no bump. This is arguably correct anyway — an org-wide required gate should pin its entrypoint reusable immutably.

After merge

Cut v1.29.0@v1 advances → re-trigger a consumer PR (empty commit on infra-cdk#151) and confirm the Security Suite check actually runs.

Validation: pinact --check exit 0 (the @v1 exemption still covers REF3 + the template); zizmor clean; no em-dashes.

Summary by CodeRabbit

  • Chores
    • Updated the security check workflow to use a fixed, pinned version for more reliable execution on pull requests.
    • Improved workflow configuration so the required security gate runs consistently without hanging.

…ite)

Regression from #86: making security-suite.yml (the org required workflow)
reference reusable-security-suite.yml via a floating @v1 stopped the suite
from running on EVERY consumer PR. The ruleset 'require workflows' injector
does not run a required workflow whose own reusable is a moving tag, so it
silently produced no run and the required 'Security Suite' check hung at
'Expected - waiting for workflow to run' forever (e.g. geolonia-infra-cdk#151).

Evidence: the only diff between the last-working release (v1.26.0, SHA-pinned)
and current @v1 (v1.28.0, floating) is this one ref; #87's own suite CI ran
green with the full @v1 chain as a NORMAL workflow, proving the inner
sub-reusable @v1 refs resolve fine at runtime. So only the top-level
required-workflow reference is affected.

Fix: SHA-pin security-suite.yml -> reusable-security-suite@82a98a9 (v1.28.0).
The inner scanner refs (reusable-security-suite -> sub-reusables) and the
workflow-templates copy stay @v1; those run as normal reusables/workflows
where moving tags work. Net: one-level chain-bump returns for the required
workflow itself; sub-reusable changes still float via @v1.
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0adad00c-c020-4b8e-8ebe-467c6e9f63c8

📥 Commits

Reviewing files that changed from the base of the PR and between 82a98a9 and 2aa171a.

📒 Files selected for processing (1)
  • .github/workflows/security-suite.yml

Walkthrough

The security-suite.yml workflow's reusable workflow reference is updated from a floating @v1 tag to a pinned commit SHA, with inline comments clarified to explain that the top-level required-workflow reference must be SHA-pinned for the org required-workflow gate to execute correctly.

Changes

Security suite workflow pin

Layer / File(s) Summary
Pin reusable workflow reference to commit SHA
.github/workflows/security-suite.yml
The uses: reference for the reusable security suite workflow is changed from @v1 to a commit SHA (commented as v1.28.0), with comments updated to document the SHA-pinning requirement.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

  • geolonia/.github#79: Both PRs change the same uses: reference for reusable-security-suite.yml in the suite job.
  • geolonia/.github#84: Both PRs pin/bump the same reusable workflow's commit SHA in the uses: reference.
  • geolonia/.github#86: Modifies the same uses: reference but in the opposite direction, floating on @v1 instead of pinning to a SHA.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/required-workflow-pin-reusable-ref

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🛡️ Security suite

Check Result
✅ Supply chain · bumblebee No exposure matches
✅ Secrets · betterleaks No secrets in diff
✅ Action pinning · pinact All actions pinned
✅ Actions audit · zizmor No findings

Note

All security checks passed.

Updated for 2aa171a · workflow run

@dkastl
dkastl marked this pull request as ready for review July 6, 2026 00:07
@dkastl
dkastl merged commit 0d7d0f2 into main Jul 6, 2026
5 of 6 checks passed
@dkastl
dkastl deleted the fix/required-workflow-pin-reusable-ref branch July 6, 2026 00:07
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