Repository navigation
Description
Agent Brief
Type: Task
Summary: Move the lane-token revoke step's shell and the pinned PyYAML install's shell into two scripts under .github/scripts/lib/, called from every copy (part of restructuring pass #15695).
Current behavior:
Line numbers are at ba7bb0da37. The work-unblock copies (work-unblock.yml:421 and below) sit in a file whose simplify chunk #15894 was still open then; if it has merged, find each step by its name.
The "Revoke the lane token" step's run: body is written out 13 times in 6 workflows, in two forms:
- 7 copies print "the lane token is revoked" on a 204 and warn otherwise:
intake-triage.yml:663-678,:2190-2205;pr-merge.yml:2332-2347,:3059-3072;work-unblock.yml:421-436,:631-646,:789-804. - 6 copies only warn:
maintenance-measure-skill-edit.yml:1207-1216,:1352-1361;maintenance-tidy-code-upkeep.yml:1357-1366,:1478-1487;upstream-apply-changelog.yml:2279-2288,:2421-2430.
All 13 send the same curl DELETE to installation/token with GH_TOKEN from steps.lane-token.outputs.token, under if: always() && steps.lane-token.outputs.token != '' and continue-on-error: true. Three chunk PRs handed this to the pass: #15914, #15802 and #15771.
Each of those jobs checks main out to .base in full, with no sparse list, and gets its token from ./.base/.github/actions/request-lane-token. So .base is there whenever the token is set (for example work-unblock.yml:158-176 then :298). All six workflows run main's workflow file: their triggers are issues, schedule, workflow_dispatch, workflow_run, push or pull_request_target.
The "Install the pinned YAML reader" step repeats the same awk extraction of the pyyaml== block from .base/.github/requirements-ci.txt, then a hashed pip install, 4 times:
pr-merge.yml:1072-1081and:2462-2471, warning "PyYAML did not install; no workflow-file change binds its review this run";pr-feedback-dispatch.yml:423-433andpr-unblock-dispatch.yml:258-271, warning "PyYAML did not install; the FAIL-cap read fails and rounds run under their own caps".
Each copy has continue-on-error: true and runs exit 1 after the warning.
.github/scripts/plugin-eval/hill-climb-workflow.test.mjs:68 asserts /DELETE/ on the measure-skill-edit revoke step's text.
Desired behavior:
- New
.github/scripts/lib/revoke-lane-token.sh, mode 100755 with a#!/usr/bin/env bashline (as.github/scripts/lib/handoff-evidence.shhas), called withbash. It readsGH_TOKENandGITHUB_API_URLand holds the 7-copy form: the samecurlline, then "the lane token is revoked" on 204, else the same::warning::line. It always exits 0. - Each of the 13 revoke steps keeps its name,
if:,continue-on-errorandenv:, and itsrun:becomesbash .base/.github/scripts/lib/revoke-lane-token.sh. - The 6 terse copies gain one success log line, "the lane token is revoked". That is the only output change; say so in the PR body.
- New
.github/scripts/lib/install-pinned-pyyaml.sh, mode 100755 with a#!/usr/bin/env bashline (as.github/scripts/lib/handoff-evidence.shhas), called withbashand taking the warning text as its one argument. It findsrequirements-ci.txtrelative to its own directory (../../requirements-ci.txt), writes$RUNNER_TEMP/pyyaml-requirements.txt, and runs the samepip installflags. On failure it prints::warning::with its argument and exits 1. - Each of the 4 YAML-reader steps keeps its name,
if:andcontinue-on-error, and runsbash .base/.github/scripts/lib/install-pinned-pyyaml.sh '<its current warning text>'. - The hill-climb assertion at
:68matches the script name instead ofDELETE.
Files:
.github/scripts/lib/revoke-lane-token.sh(new).github/scripts/lib/install-pinned-pyyaml.sh(new)- the revoke steps at
intake-triage.yml:663,pr-merge.yml:2332,work-unblock.yml:421,maintenance-measure-skill-edit.yml:1207,maintenance-tidy-code-upkeep.yml:1357andupstream-apply-changelog.yml:2279, and their other copies listed above - the YAML-reader steps at
pr-merge.yml:1072,pr-feedback-dispatch.yml:423andpr-unblock-dispatch.yml:258 .github/scripts/plugin-eval/hill-climb-workflow.test.mjs(line 68 only)
Key interfaces:
- Step names: unchanged.
callers.test.mjs:1294-1324,merge-job.test.mjs:355,608andpr-merge/workflow.test.mjs:1138order steps by the name "Revoke the lane token". - Token scope and log shape: each step stays one
runstep. No composite action is added, so there is no nested log group, and the token goes only to the step that held it. pr-run-activity-write.yml:1889-1913's github-script revoke andrequest-lane-token's own internalrevoke()(.github/actions/request-lane-token/action.yml:299-304) stay as they are: they differ, andscripts/write-runner-revoke-step.test.shtests the first.pr-require-checks.yml:1421-1424's full-requirementspip installis a different step and stays.
Acceptance criteria:
- The revoke
curlDELETE exists once, in.github/scripts/lib/revoke-lane-token.sh, and every revoke step that ran it inline calls that script. - The
pyyaml==awk extraction exists once, in.github/scripts/lib/install-pinned-pyyaml.sh, and each of the four YAML-reader steps that ran it calls that script with its own warning text. - Every step name,
if:,continue-on-error,env:key, job id, trigger, permission and workflow file name is unchanged. - Behavior is unchanged except the one success log line the terse revoke copies gain.
- The diff edits only the listed files and the lines of a test that assert on them when the change breaks that assertion.
- The pull request stays within 400 changed lines and 15 hand-edited files.
- Both scripts pass the repository's shellcheck and shfmt checks.
- ci-status is green.
Out of scope:
- The github-script revoke in the write runner, request-lane-token's internal revoke, the full-requirements install in the required-checks workflow, other duplication, eval cases, fixtures, and skill and agent text.
Metadata
Metadata
Assignees
Labels
Type
Fields
Work status
Priority
Activity