Skip to content

validate-actions-lock prescribes a cure that can re-legitimise a blocked action version #981

Description

@hyperpolymath

The defect

When a workflow uses: ref is absent from actions.lock, the gate emits:

[validate-actions-lock] ERROR: not in actions.lock: github/codeql-action/upload-sarif@1c5b675...
    Regenerate with the LOCKFILE ONLY, and verify the *.yml diff is empty:
      gh actions-lock <workflow paths> --no-migrate-local-actions --no-narrow

A lock/workflow drift has two possible stale sides, and this message picks one blindly. It always assumes the workflow is right and the lock is behind.

Hit live today (#977 → #978). The lock correctly carried codeql-action@b96794f (v4.38.0); three workflows had been reverted to 1c5b675 (v4.38.1) — a version under an explicit estate hold because it startup-kills workflows (nexia-list#100). Following the prescribed cure verbatim would have written 1c5b675 back into the lockfile, re-legitimising the exact version the #973 incident fix was escaping, and converted a loud gate failure into a silent estate-wide outage.

The correct cure there was the opposite: update the workflows to the SHA the lock already held, and leave actions.lock untouched.

Why it matters beyond this instance

Acceptance criteria

  1. On a missing-ref error, the gate reports which side is stale rather than assuming — e.g. when the lockfile already holds a different SHA for the same owner/repo, say so explicitly and name both SHAs.
  2. In that case the message must not recommend regeneration as the first cure; it should recommend reconciling the workflow ref to the locked SHA, or state that a deliberate upgrade requires changing both.
  3. A regression test covering the two-sided case: lock holds SHA-A for owner/repo, workflow references SHA-B → the gate's output names both SHAs and does not prescribe bare regeneration. Mutating the message back to the current text must fail that test.
  4. No change to the single-sided case (genuinely new action added, lock simply behind), which keeps the existing guidance.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01WPSJ7fBhVAMcpSffCBWUDo

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions