Repository navigation
fix(release): bridge the release app secrets with a token fallback, read Windows eligibility from the API, and scope the app tokens - #108
Merged
Conversation
…release entry declares
…s antelopejs-sync writes it
… uses, and end dirname options
… a symlink or submodule, or escapes the checkout
…ck and neither, in releases and next-sync
…ot forward the app secrets
… secrets in the README's multi-package caller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wec9b4589-40.
Why
Goal: fix the defects the verification of main at 0b40536 found before
v2moves, and close the hardening gaps in the same files.RELEASE_GITHUB_TOKEN. Since feat(release): push releases and next-sync merges with the antelopejs-release app token #105 a stable or repin run exits 1 withoutRELEASE_APP_IDandRELEASE_APP_PRIVATE_KEY, andcaller.test.tspassed only because both secrets are optional. README and AGENTS.md disagreed on whether callers must change.ci-node.ymldecided the Windows legs ongithub.event.repository.visibility, which GitHub does not document for theschedulepayload, so a public repository could lose its nightly Windows legs.v2deadlocked.v2(ebac4e8) does not declare the app secrets, so a caller re-synced with tooling-configs#441 hitsstartup_failure(tooling-configs' Release run 44826303980). Main exits 1 without them, so oncev2moves every caller not yet re-synced fails its stable or repin release.create-github-app-tokencall minted a token with every permission of the installation, anddirnametook paths without--.What
release-npm.yml, both wrappers andnext-sync.ymldeclareRELEASE_GITHUB_TOKEN,RELEASE_APP_IDandRELEASE_APP_PRIVATE_KEYas optional, and the wrappers forward all three. A stable, repin or next-sync run mints the app token when both app secrets are set. Otherwise it writes withRELEASE_GITHUB_TOKENand logs a warning, and it fails only when neither is set. Sequence: merge this, movev2, re-sync the callers, revoke the token, then remove the fallback.frozen-caller.yml, the starter workflow and the README example are now byte-identical to therelease.ymltooling-configs#441 generated at ef8abf5:pull_requestpreview trigger, and both app secrets forwarded.caller.test.tsnow requires the caller to forward every secret the entry declares, so a caller with onlyRELEASE_GITHUB_TOKENfails.antelopejs-syncwrites them, an older caller keeps working through the fallback, and the fallback goes away once every caller is re-synced and the token is revoked.Windows eligibilityjob runs only when Windows legs could run (same event and input conditions as before), reads the visibility with onegh api repos/$GITHUB_REPOSITORY --jq .visibilitycall on the job'sGITHUB_TOKEN, and thenodematrix addswindows-latestonly when it returnspublic. A failed gate fails the run throughchecksinstead of silently dropping Windows.release-npm.ymlcontents: writeandpull-requests: read(release notes rungh pr list),next-sync.ymlandmodule-locks-renovate.ymlcontents: write,module-locks-refresh.ymlcontents: writeandpull-requests: write.module-locks-refresh.ymlchecks the refresh patch in a scratch index before the release app token pushes it. It fails when the patch touches.github/or.gitmodules, adds a symlink or a submodule, or holds a pathgit applyrefuses (.git, outside the checkout). The refresh keeps its documented scope: it still commits the range moves inpackage.jsonandantelope.config.ts,pnpm-lock.yamland the output of the caller'scommands. The task's Done means first asked to limit the patch toantelope-lock/paths as the renovate job does. That was wrong for this job, which the orchestrator confirmed: the renovate job copies only locks because Renovate already wrotepackage.json, while the refresh is built to commit more.module-locks-renovate.ymlrunsdirname --in both its calls, and the README's multi-package caller example forwards the app secrets and uses the generator'sif.flowchart LR R[stable / repin / next-sync run] --> C{RELEASE_APP_ID and<br/>RELEASE_APP_PRIVATE_KEY set?} C -->|yes| A[mint the app token, scoped permissions] C -->|no| T{RELEASE_GITHUB_TOKEN set?} T -->|yes| P[write with RELEASE_GITHUB_TOKEN, warning] T -->|no| X[fail]Related issue
Wec9b4589-40, from the verification of AntelopeJS/.github at 0b40536 (ANT-2010 / #105 and Wec9b4589-35 / #107).
Verification
The caller test, before the caller fix (commit ca0b51f):
After:
ℹ pass 10,ℹ fail 0forcaller.test.ts.The fallback tests (app secrets only, token only, neither, for stable, repin and next-sync), run against the workflows of 86d2833:
After:
ℹ pass 140,ℹ fail 0.The token permission test, before the workflow change (commit e0c02aa):
Windows legs on a
schedulepayload that names no repository, evaluating theosexpression of main and of this branch. The payload withoutrepositoryis inferred from GitHub's payload docs, not captured from a run:Checks on the final commit, Node.js 24:
The refresh patch tests, run against main's
module-locks-refresh.yml:One patch that adds
.github/workflows/x.ymland a symlink, applied by main's push step and checked by the new step:Checklist
v2moves: an older caller releases through theRELEASE_GITHUB_TOKENfallback until it is re-synced.Skills
no skill change
Follow-ups
main) pushes.github/workflows/*changes with the antelopejs-release app token, which GitHub refuses unless the token holdsworkflows: write; the installation grants onlycontentsandpull_requests, so this predates this pull request and is unverified on a real run. Done means: the app installation grantsworkflows: write, next-sync askspermission-workflows: write, and a sync that brings a workflow change frommainintodeveloppushes.