Skip to content

feat(actions): actions.lock is regenerated with the update, or the update is held - #303

Merged
sweepies merged 1 commit into
mainfrom
feat/actions-lock
Nov 14, 2026
Merged

sweepies merged 1 commit into
mainfrom
feat/actions-lock

Conversation

@sweepies

@sweepies sweepies commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

A repository that already commits .github/workflows/actions.lock gets it regenerated in the same commit as the action update, or the update is held with the tool's reason. This is PR 3 of the actions.lock work, after #300 (the tool pin and the offline proxy fixture) and #302 (the scoped token).

Behaviour change

  • Planning: an Ecosystem::Actions job is planned when the lock exists and the dependency is a step-level action in a .github/workflows/ workflow. Reusable workflows, images, .forgejo and .gitea workflows make no job.
  • In-repo composite actions: a composite the workflows call as ./… is never locked by the tool, so bumping an action inside it publishes without touching the lock. One called with the tool's $/… syntax is relocked under each listed workflow that calls it, nested composites included, resolved the way the tool resolves them. If a caller can't be resolved (a listed workflow that doesn't parse, say), the update is held.
  • The run: gh-actions-lock --no-interactive --no-onboard --no-narrow --ignore-local-actions runs over the edited workflows the lock lists, plus the listed workflows that call an edited $/ composite. The tool gets a whitelisted environment: GH_HOST=github.com, gh and git off its PATH, and CI=false.
  • Token: the App server gives the tool a read-only token scoped to the repository. The CLI and the Action reuse the run's own token. Either way the token is masked in all tool output.
  • Proof: --verify-local must pass, and a read-back must find each edited owner/repo@ref under its workflow with the edited SHA. Only actions.lock may change.
  • Held, with the reason shown:
    • a pin no longer in upstream history;
    • a private action the token cannot read;
    • an action the lockfile does not list yet (the Count never onboards);
    • the token refused;
    • a corrupt or newer lockfile.
      GitHub being unreachable or rate-limited makes the update wait for the next run instead.
  • SHA pins: workflows the lock lists get no new step-level SHA pins, because the lock records the commit. Existing pins still move, and reusable workflows still pin. Both this and the scoped run are listed as departures.
  • Install: the tool comes from its own descriptor. PR 1's interim actions_lock_spec is gone.

Tests

  • Driver tests cover the token kind, the scope, an unlisted workflow (no tool run), the widened scope, a corrupt lock, verify and read-back failures, an unexpected write, an unchanged lock, and masking of a token the tool echoes.
  • pin_suppressed covers its four cases.
  • A real-tool run replays the new cassette actions-lock-update.json (public actions/checkout, token redacted, the fixtures scan is clean).
  • An engine write test checks that the commit holds both the workflow and the lock.
  • corpus:snapshot is unchanged: no corpus repository has a lock. Transcripts gain one line for the new test.
  • The state rows are rehashed.

Follow-ups

  • Private actions through an operator setting (today they are held).
  • No release-age wait on what --relock picks up (PR 4: lockfile maintenance).
  • The tool's fresh-tag warning is not shown.
  • Re-recording a cassette churns its headers; a testkit header filter would fix that.
  • A $/ composite reached through a symlinked action directory is missed at planning, so its bump publishes without a relock. GitHub's tree lists the symlink as one entry. The fix is to treat it as unresolvable and hold.
  • One resolution error, such as one listed workflow that doesn't parse, holds every in-repo composite bump in the repository, including ./-only ones. This fails closed and the reason names the file, but it could be narrowed to the composites the broken chain can reach.
  • The tool has a 180 s timeout, which a widened run on a large repository could hit (that update would then be held).

Review fixes

  • The read-back checks step-level actions only (the tool never locks jobs.<id>.uses).
  • Lock keys are compared the way the tool writes them: owner/repo lowercased, so Azure/login@v2 works.
  • The read-back covers only the workflows the run scoped, so a grouped bump across listed and unlisted workflows publishes.
  • The lock's workflows: map is read strictly to the tool's grammar, and only plain .github/workflows/<name>.y(a)ml keys reach the tool.
  • Maintenance no longer claims actions.lock (--relock comes in PR 4).
  • Real-tool cassettes pin that the tool never locks a ./ composite and does relock a $/ composite under its caller.
  • Two new real-tool cassettes pin that, with --no-narrow, an existing SHA pin in a listed workflow is left as written and recorded in the lock under that SHA. So existing pins keep moving.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
count-patchula c8ac31e Commit Preview URL

Branch Preview URL
Nov 14 2026, 01:50 AM

…date is held

A repository that already commits .github/workflows/actions.lock gets it
regenerated in the same update commit when a listed workflow's action
moves: gh-actions-lock runs over the edited listed workflows only, with
--no-onboard and --no-narrow always set. The tool never locks a local
./ composite, so a bump inside one makes no run and publishes as before;
a $/ composite is relocked under exactly the listed workflows that call
it, and a caller that cannot be resolved holds the update. The tool gets
a scoped
installation token on the App server and the run's own token elsewhere,
github.com only, gh and git off its PATH; --verify-local and a lockfile
read-back prove the result before the commit opens.

Workflows the lock lists get no new step-level SHA pins, since the lock
itself records the commit; existing pins still move and reusable
workflows still pin. A moved pin stays a pin: --no-narrow leaves a SHA
ref as written and the lock records it under that SHA. A private action,
a corrupt lockfile or an onboarding attempt holds the update instead of
publishing.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@sweepies
sweepies merged commit e894c77 into main Nov 14, 2026
13 checks passed
@sweepies
sweepies deleted the feat/actions-lock branch November 14, 2026 01:58
@sweepies-ops sweepies-ops Bot mentioned this pull request Nov 14, 2026
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