Skip to content

fix(ci): unbreak workflow YAML and add a complete actions.lock - #109

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/workflow-dependency-locking
Aug 27, 2026
Merged

fix(ci): unbreak workflow YAML and add a complete actions.lock#109
hyperpolymath merged 1 commit into
mainfrom
fix/workflow-dependency-locking

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Remediates GitHub Workflow Dependency Locking (public preview, no changelog entry), which rejects runs at startup_failure — zero jobs, no logs, nothing in REST or GraphQL. Full analysis: hyperpolymath/standards#657.

Proven on hyperpolymath/anamnesis: 6 of 6 workflows dead → 0 startup_failure, 13 running.

Five steps, in order — each blocks the next

1. Unbreak the workflow YAML. Any permissions: carrying a scalar with an indented mapping under it:

permissions: read-all
  actions: read        # <- mapping under a scalar. Unparseable.

This reaches past the one file: gh actions-lock refuses to run when any workflow in the repo fails to parse, so the repo can never acquire a lockfile and can never self-heal.

2. Repin standards reusables off commits with no actions.lock. The rejection requires the callee to be covered at the pinned SHA — unsatisfiable at a pre-lockfile commit.

3. Generate the lockfile with gh actions-lock.

4. Hand-add the reusable-caller entries the tool omits, as '<path>': [].

⚠️ Measured across 218 repos: P(startup_failure | has lockfile) = 91.7% vs 15.8% without — because every workflow a lockfile omits is rejected. A partial lock is worse than none. Running gh actions-lock and stopping there is how this outage spread.

5. Restore SPDX-License-Identifier to line 1, which the tool displaces with its own banner and which the workflow-security linter greps via head -1.

Verified before this PR was opened

0 unparseable workflows · lockfile covers every workflow, no omissions · SPDX on line 1 in every file. The script refuses to push if any of the three fails.

🤖 Generated with Claude Code

Remediates GitHub Workflow Dependency Locking (public preview), which
rejects runs at startup_failure with zero jobs and no logs. See
hyperpolymath/standards#657.

Five steps, in order, because each blocks the next:

1. Unbroke any workflow whose `permissions:` carried a scalar with an
   indented mapping under it - blind-permissions-insertion damage. This
   matters beyond the one file: gh actions-lock refuses to run when ANY
   workflow in the repo fails to parse, so the repo could never acquire a
   lockfile and could never self-heal.

2. Repinned hyperpolymath/standards reusables off commits that have no
   actions.lock. The rejection requires the CALLEE to be covered at the
   pinned SHA, which is unsatisfiable at a pre-lockfile commit.

3. Generated the lockfile with gh actions-lock.

4. Hand-added the reusable-workflow caller entries the tool omits, as
   '<path>': []. Measured across 218 repos: P(startup_failure | has
   lockfile) = 91.7% vs 15.8% without, because every workflow a lockfile
   OMITS is rejected. A PARTIAL lock is worse than none - running
   gh actions-lock and stopping there is how this outage spread.

5. Restored SPDX-License-Identifier to line 1, which the tool displaces
   with its own banner and which the workflow-security linter greps with
   head -1.

Verified before push: 0 unparseable workflows, lockfile covers every
workflow with no omissions, SPDX on line 1 in every file.

Proven on hyperpolymath/anamnesis: 6 of 6 workflows dead -> 0
startup_failure, 13 running.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hyperpolymath
hyperpolymath merged commit a95bdb8 into main Aug 27, 2026
1 check passed
@hyperpolymath
hyperpolymath deleted the fix/workflow-dependency-locking branch August 27, 2026 10:33
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@gitar-bot

gitar-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 16 high

Alerts:
⚠ 16 issues (≤ 0 issues of at least minor severity)

Results:
16 new issues

Category Results
Security 16 high

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1342c5be-93e5-45b9-a2cf-d3ade4c97717

📥 Commits

Reviewing files that changed from the base of the PR and between 8676ce4 and 6572451.

⛔ Files ignored due to path filters (1)
  • .github/workflows/actions.lock is excluded by !**/*.lock
📒 Files selected for processing (21)
  • .github/workflows/boj-build.yml
  • .github/workflows/casket-pages.yml
  • .github/workflows/cflite_batch.yml
  • .github/workflows/cflite_pr.yml
  • .github/workflows/ci.yml
  • .github/workflows/codeql.yml
  • .github/workflows/dependabot-automerge.yml
  • .github/workflows/dogfood-gate.yml
  • .github/workflows/finishingbot.yml
  • .github/workflows/glambot.yml
  • .github/workflows/governance.yml
  • .github/workflows/hypatia-scan.yml
  • .github/workflows/instant-sync.yml
  • .github/workflows/mirror.yml
  • .github/workflows/push-email-notify.yml
  • .github/workflows/rhodibot.yml
  • .github/workflows/scorecard.yml
  • .github/workflows/seambot.yml
  • .github/workflows/secret-scanner.yml
  • .github/workflows/spark-theatre-gate.yml
  • .github/workflows/workflow-linter.yml

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated automated workflow actions and reusable workflow references across CI, security scanning, testing, deployment and notification processes.
    • Standardised action version references and recorded workflow management metadata.
    • Adjusted workflow permissions for improved clarity and control.
    • Workflow logic and job behaviour remain unchanged.

Walkthrough

Changes

The pull request updates 20 GitHub Actions workflow files. It adds gh actions-lock comments, changes selected action references from commit SHAs to tags, updates reusable workflow commits, and narrows permissions in workflow-linter.yml.

Workflow reference updates

Layer / File(s) Summary
Action version updates
.github/workflows/boj-build.yml, .github/workflows/casket-pages.yml, .github/workflows/cflite_*.yml, .github/workflows/ci.yml, .github/workflows/codeql.yml, .github/workflows/dependabot-automerge.yml, .github/workflows/finishingbot.yml, .github/workflows/glambot.yml, .github/workflows/instant-sync.yml, .github/workflows/push-email-notify.yml, .github/workflows/rhodibot.yml, .github/workflows/seambot.yml
Selected actions now use version tags instead of pinned commit SHAs.
Validation workflow action updates
.github/workflows/dogfood-gate.yml
Checkout, A2ML, and K9 validation steps now use the specified tag or branch references.
Reusable workflow and permission updates
.github/workflows/governance.yml, .github/workflows/hypatia-scan.yml, .github/workflows/mirror.yml, .github/workflows/scorecard.yml, .github/workflows/secret-scanner.yml, .github/workflows/spark-theatre-gate.yml, .github/workflows/workflow-linter.yml
Reusable workflow references use commit 84355587cb2a1f86e6882de83514a32db2646e7a. The workflow linter uses actions: read permissions.

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested reviewers: metadatastician

Poem

A rabbit checks each workflow line
Tags now mark the action sign
SHA pins hop out of sight
Permissions stay scoped and tight
Green paths guide the build tonight

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codacy-production codacy-production 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.

Pull Request Overview

The PR is currently not up to standards according to Codacy and automated reviews. While it attempts to implement a dependency locking strategy using gh actions-lock, it introduces several critical issues that must be addressed before merging:

  1. Functional Regression: The workflow-linter.yml is missing contents: read permissions, which will cause the checkout step to fail and break the CI pipeline.
  2. Security Regression: The PR systematically replaces immutable commit SHAs with mutable version tags. This increases supply chain risk and directly conflicts with the project's existing security policies and automated linter logic.
  3. Missing Artifact: The core file intended to manage these dependencies, .github/workflows/actions.lock, was not included in the provided diff, making it impossible to verify the locking implementation.
  4. Linter Conflict: The updated tag-based format will cause the existing 'Check pinned actions' security gate to fail, as it specifically expects inline SHA comments.

About this PR

  • Systematic removal of full-length commit SHAs across all workflows violates the established security policy. While the goal is to use a lock file, the workflows should ideally maintain the SHA in the uses: field (or as a trailing comment) to ensure compatibility with existing security scanners and to provide defense-in-depth against tag-moving attacks.
  • The file .github/workflows/actions.lock is missing from this PR. Since this file is the central mechanism for the proposed dependency locking strategy and manual entries were mentioned in the description, it must be included for verification.
1 comment outside of the diff
.github/workflows/workflow-linter.yml

line 53 ⚪ LOW RISK
Suggestion: The regex uses:.*@v[0-9] combined with grep -v '#' will now flag all updated workflows as 'unpinned' despite them being tracked in the lock file. The linter logic needs to be updated to account for the actions.lock file to avoid constant CI warnings.

Test suggestions

  • Validate that the permissions block in workflow-linter.yml is valid YAML and permits the 'actions: read' mapping.
  • Verify that all modified workflow files have the SPDX header on line 1 and the tool banner on line 2.
  • Verify that the actions.lock file contains entries for all workflows, including manual caller-path entries as specified in Step 4.
  • Confirm that the 'Check pinned actions' step in the linter still functions or is updated for the new locking strategy.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that the actions.lock file contains entries for all workflows, including manual caller-path entries as specified in Step 4.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback


- name: Cache dependencies
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2
uses: Swatinem/rust-cache@v2.7.8

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

This PR systematically removes immutable commit SHAs. While updating to specific version tags is useful for readability, the loss of the SHA pin creates a supply chain security risk. Ensure your configuration maintains SHAs in the uses: field to satisfy local security requirements.

See Issue in Codacy

- name: Fetch Dependabot metadata
id: meta
uses: dependabot/fetch-metadata@dbb049abf0d677abbd7f7eee0375145b417fdd34 # v2.2.0
uses: dependabot/fetch-metadata@v2.2.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

Avoid removing the commit SHA when updating actions. Pinning to a full-length commit SHA is the only way to ensure the action used is immutable and protected against upstream tampering.

Suggested change
uses: dependabot/fetch-metadata@v2.2.0
uses: dependabot/fetch-metadata@dbb049abf0d677abbd7f7eee0375145b417fdd34 # v2.2.0

See Issue in Codacy

- name: Validate A2ML manifests
if: steps.detect.outputs.count > 0
uses: hyperpolymath/a2ml-ecosystem/validate-action@aa4b836bd969df2bc58128cb8e3d20bbc88d5e79 # main
uses: hyperpolymath/a2ml-ecosystem/validate-action@main

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

Do not pin actions to a branch like @main. This makes your workflow non-deterministic and vulnerable to malicious or breaking changes in the source repository. Always use a full-length commit SHA.

Try running the following prompt in your IDE agent:

Find the latest commit SHA for the repository hyperpolymath/a2ml-ecosystem/validate-action and replace '@main' with that SHA in .github/workflows/dogfood-gate.yml.

See Issue in Codacy

Comment on lines +14 to 15
permissions:
actions: read

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

The workflow will fail because it lacks the permission to clone the repository. Add contents: read to the global permissions block.

Suggested change
permissions:
actions: read
permissions:
contents: read
actions: read

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@v4.1.7

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

This change replaces a pinned commit SHA with a mutable version tag. This reduces security (as tags can be moved) and violates the project's policy of pinning actions with SHAs. Revert to the action@SHA # version format to comply with the local security linter.

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