Repository navigation
Conversation
yashwanthkumarsuruneni
requested review from
TerryHowe,
shizhMSFT and
wangxiaoxuan273
as code owners
November 29, 2026 17:03
Member
|
Thanks! This is approved and all checks pass, but it can't be merged yet: The easiest way to sign is with an SSH key:
Afterwards, the commit should show a Verified badge. If it doesn't, check that the email in |
Split update-releases.yml into two jobs. 'update' runs npm ci, the update script and the build with a read-only token and no Environment, and uploads the result as a patch. 'pr' applies the patch and opens the PR with a token minted from the release App in the main-only release Environment, so CI starts on the bot's PRs and the App key never shares a job with third-party package code. The author and committer are set to the App's bot identity so the Signed-off-by trailer matches the commit. inputs.version is passed to the script through env instead of being expanded into the shell. Closes oras-project#237 Closes oras-project#238 Signed-off-by: Yash <20724658+yashwanthkumarsuruneni@users.noreply.github.com>
yashwanthkumarsuruneni
force-pushed
the
ci/update-releases-app-token
branch
from
November 29, 2026 18:04
52203bf to
52be1aa
Compare
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.
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.npm ci, the update script andnpm run build, as before.inputs.versionnow reaches the script as$INPUT_VERSIONthroughenv:(ci: update-releases interpolates workflow_dispatch input into shell #237).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: {}.persist-credentials: false, downloads the artifact and runsgit apply. No npm runs in this job.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.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.mainopens a PR authored by the botoras-release-test-5f939a[bot]: adds 1.4.0 back and bumps the default to 1.4.0verified: true (valid);Signed-off-bymatches the commit author (the App bot)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)updateran,prrefused withBranch "gate-test" is not allowed to deploy to release due to environment protection rulesactionlint(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".