Repository navigation
fix(release): harden the release pipeline before signing secrets land - #1
Merged
Merged
Conversation
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.
Fixes the systems review of
144dbeabefore any signing secrets are added to thesigningenvironment.Findings
devis the default branch, so a production run could restore a cache a dev run wrote.setup-bungetsno-cache: true, the Azure signing actioncache-dependencies: false, and bothsetup-nodestepspackage-manager-cache: false. No other step restores a cache.lib.shhelpersmembers,unpackandrepack.unpacklists a tarball first and requires exactly the target's regular files, each once (no links, directories, duplicates or extras), then extracts by those names.repackpacks the fixed names plus the signature, never a list read back from the unpacked tree, which removes thetar -Tnewline injection. Used bysign-linux.sh,sign-macos.sh,windows-binaries.shandscript/e2e/signed.sh..github/release/client.sh.sha256pins theclient.shthe service serves today (f19e3852…526e).release_clientchecks it before running, inpublish-release-service.shand infinish. RELEASING.md says how to move the pin.reserve-tagjob createsrefs/tags/v<version>at the run's SHA through the API before anything publishes. If the tag exists, it peels annotated tags and fails unless the tag is at that SHA.finishchecks the tag again, then runsgh release create --verify-tag, or re-uploads with--clobberon a rerun after the release exists. A rerun at the same SHA finds its own tag and goes on.install()dropscli.prevwhen setup moves the install to another channel, andrestore/previousCommandrefuse a kept build from another channel before self-testing it.src/update/environment.ts.tar,codesign, PowerShell and a new build's self-test run with a fixed environment. The detached updater keeps only what the CLI reads (data directories,OPENCODE_*, proxies, CA files, agent config locations includingHERMES_DATA_DIR_SUFFIX) and drops the rest (TAR_OPTIONS,BUN_OPTIONS,NODE_OPTIONS,LD_PRELOAD, …). On Windows,SystemRootis trusted only as<drive>:\Windows; anything else falls back toC:\Windows.devcounts (isCrossRepository == falseandheadRepository.nameWithOwner), so a fork'sdevcan't suppress it.repo:anomalyco@66570915/opencode-console-cli@1452060248:environment:signing; the repository uses immutable OIDC subjects..githubpush ruleset is described as private-only.::add-mask::) when moving to AWS Secrets Manager, and that writers can rerun failed jobs of a maintainer-dispatched run./console/install, which isn't served yet; they use theraw.githubusercontent.comproductionURLs until Console's proxy ships.Settings changed (already applied)
GITHUB_TOKENis read-only. "Allow GitHub Actions to create and approve pull requests" stays on for the promotion workflow. Every workflow sets its ownpermissions.production: maintainers mergeadds anupdaterule onrefs/heads/production. Only the Repository admin and Maintain roles can bypass it, so only a maintainer can merge the promotion PR. It's a separate ruleset, so the bypass doesn't also exempt maintainers fromproduction's PR andChecksrules. A write-role user is blocked; verified by reading the effective rules, since it can't be tested without a write-role account.devruleset is unchanged.Red/green (Linux VM, GNU tar 1.35)
package/LICENSE, newline in a member name, extra/duplicate/link members, Windows signerlib.shand signersclient.shthat isn't the pinned one is refused before it runslib.shwithout the hash checkreserve-tag: tag at another commit; annotated tag peeledsrc/install.ts; the guard alone removedcli.prevsrc/install.tsTAR_OPTIONSorBUN_OPTIONSTAR_OPTIONS=--exclude=package/bin/opencode-consoleself-update.ts(Linux; macOS's bsdtar ignoresTAR_OPTIONS)HERMES_DATA_DIR_SUFFIXand finds the same Hermes homeKEPTwithout itGiven a crafted tarball (a directory at
package/LICENSEholdingaanda\n/tmp/…/runner-secret), the originalsign-linux.shexited 0 and its signed tarball carried the runner's file. The new one refuses before extracting.Also passing on the VM:
bun run check,bun run test(846 pass, 2 macOS-only skips),script/e2e/run.sh36/36,script/e2e/signed.sh30/30.Not tested
tar.exeresolved from the validatedSystemRoot. Nothing here ran on Windows.reserve-tagoutside its stand-in: it's tested against a stand-ingh api, not GitHub's API.checkruns skip it because it needscontents: writeandcheckcan run from any branch. Its first real run is the first stable release.