Skip to content

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

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#95
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 b3fd37e into main Aug 27, 2026
32 of 36 checks passed
@hyperpolymath
hyperpolymath deleted the fix/workflow-dependency-locking branch August 27, 2026 05:23
@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 9 high

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

Results:
9 new issues

Category Results
Security 9 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.

@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 analysis. While the intent is to stabilize CI workflows, there are significant gaps in the implementation of the stated acceptance criteria. Most notably, the .github/workflows/actions.lock file is missing from the diff, and the requirement to pin workflows to commit SHAs has been violated by several regressions to mutable tags or branch references (e.g., using @main in dogfood-gate.yml). Furthermore, the static-analysis-gate.yml workflow contains critical redirection errors that would likely corrupt JSON findings with stderr logs, causing the security gate to fail silently by defaulting to an empty set of results when jq fails.

About this PR

  • The .github/workflows/actions.lock file is mentioned in the PR title and acceptance criteria as a primary deliverable, but it is missing from the provided changes. Verification of the dependency locking mechanism cannot be performed.
  • The PR description identifies a fix for nested permission mappings in YAML, but no such change is visible in the workflow diffs. Please verify if all intended YAML fixes were committed.
3 comments outside of the diff
.github/workflows/static-analysis-gate.yml

line 50 🔴 HIGH RISK
Redirecting stderr to the findings file will likely corrupt the JSON output, causing subsequent validation steps to fail and findings to be ignored. Remove the stderr redirection so logs go to the GitHub Actions console instead.

          panic-attack assail --format json . > panic-attack-findings.json

line 167 🔴 HIGH RISK
Remove the 2>&1 redirection to prevent log output from corrupting the JSON file, which would cause jq to fail and the security scan to return empty results.

          HYPATIA_FORMAT=json "$HOME/hypatia/hypatia-cli.sh" scan . > hypatia-findings.json

line 268 🔴 HIGH RISK
Remove the 2>&1 redirection to ensure the bridge report remains a valid JSON file even if the tool emits warnings.

          panic-attack bridge triage --format json . > bridge-report.json

Test suggestions

  • Validate that the first line of all workflows starts with '# SPDX-License-Identifier:'
  • Verify that all 'uses:' statements in workflows point to a specific version or SHA instead of mutable tags like 'main'
  • Verify that workflows calling reusable actions include the 'actions: read' permission
  • Confirm that actions.lock contains entries for all workflows including reusable callers
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Confirm that actions.lock contains entries for all workflows including reusable callers

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

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