ci: open update-releases PRs with the release GitHub App token #242
All Vouch review confidence checks passed
Residual risk 0.31 = Change Risk (0.73) × (1 − Review Confidence (0.58)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.73 · 576 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.380
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.073
Real PR Conversation Timeline
1 comments
"Review active on #242"
general
weight: 0.35
TerryHowe
Opens the
update-releasesPRs with theoras-project-release-botApp token, so CI starts on them by itself, and keeps the App key away fromnpm ci. It also fixes the input injection from #237, as #238 proposes.Closes #237
Closes #238
Changes
.github/workflows/update-releases.ymlis split into two jobs, and the top-levelpermissions:is now{}:update: no Environment,contents: read, checkout withpersist-credentials: false.- Runs
npm ci, the update script andnpm run build, as before.-
inputs.versionnow reaches the script as$INPUT_VERSIONthroughenv:(#237).- When either output is set, it stages everything with
git add -Aand uploadsgit diff --cached --binaryas thechangesartifact (1-day retention). Staging first means files that are new indist/are included, and deleted files are removed..gitignored build output is left out.-
ADDED_VERSIONSandDEFAULT_VERSIONbecome job outputs.pr:needs: update, runs only when either output is non-empty,environment: release,permissions: {}.- Checks out with
persist-credentials: false, downloads the artifact and runsgit apply. No npm runs in this job.- Mints the token with
actions/create-github-app-token, pinned to the same SHA oras-go uses (f418cff…, v3.4.0), withrepositories: setup-oras,permission-contents: writeandpermission-pull-requests: write.- Runs
create-pull-requestwith that token and an explicitauthor/committer.commit-message,titleandbodynow readneeds.update.outputs.*; the rest (sign-commits,signoff, branch, body text) is unchanged.RELEASING.mdgains a paragraph on the two jobs under "Automatic patch releases", and a "GitHub App" section next to "Deploy key". It covers what the App can do here, thatRELEASE_APP_ID/RELEASE_APP_KEYlive only in themain-onlyreleaseEnvironment, that the App isn't arelease-tagsbypass actor, and that an org owner rotates the key.Two changes from the issue's sketch:
author/committeridentity is built from the token action'sapp-slugoutput andGET /users/{slug}[bot], instead of the literaloras-project-release-bot[bot] <362079208+…>. Upstream it resolves to that same value. It also keepsSigned-off-bymatching the commit's real author if the App is ever replaced, and it let me test DCO on a fork with a different App.prjob checks out the run's commit, asupdatedoes, rather than namingmainexplicitly. ThereleaseEnvironment only deploys frommain, so that commit is onmainand the patch applies to the exact tree it was made from.Testing
I tested on my fork
yashwanthkumarsuruneni/setup-oras:contents: writeandpull_requests: writereleaseEnvironment whose deployment branches aremainonlyTo give the workflow something to add, fork
mainhad one extra fork-only commit that drops CLI 1.4.0 fromreleases.jsonand sets theaction.ymldefault back to 1.3.6.| Done-when item | Result |
|---|---|
| Dispatch from
mainopens a PR authored by the bot | run → PR #2 byoras-release-test-5f939a[bot]: adds 1.4.0 back and bumps the default to 1.4.0 || Its commit shows as Verified |
verified: true (valid);Signed-off-bymatches the commit author (the App bot) || CI starts without anyone triggering it |
Tests,Check dist/andLicense Checkerstarted on the PR with the bot as actor;TestsandCheck dist/passed (DCO isn't installed on my fork, so I checked the sign-off by hand as above) || Dispatch from another branch fails at the Environment gate | run:
updateran,prrefused withBranch "gate-test" is not allowed to deploy to release due to environment protection rules|actionlint(with shellcheck) passes on the workflow.Not covered: a run where the rebuild changes
dist/. My fork-only commit didn't rebuilddist/, so the rebuilt bundle was identical and the patch only touchedreleases.jsonandaction.yml. The patch handling is the same either way. The first real CLI release after this merges will exercise it, andcheck-distwill catch any mismatch.After this merges, #240 can turn off "Allow GitHub Actions to create and approve pull requests".