18 Commits
Author SHA1 Message Date
Miguel Ángel 9b565c8e02 fix(release): a release merged in one push with other PRs publishes at its own commit (#8077)
* test(release): a release merged in one push with other PRs is found and published at its own commit

* fix(release): a release merged in one push with other PRs publishes at its own commit
2026-11-17 15:22:14 +00:00
Miguel Ángel c106793f79 fix(release): publish to npm with the job's OIDC token, not a stored token (#8070)
* test(release): npm publishes with the job's OIDC token, no stored token named

* fix(release): publish to npm with the job's OIDC token, not a stored token

* test(release): catch a secret named by index or inherited, not only secrets.X
2026-11-17 12:20:49 +00:00
Miguel Ángel 4807799c4e fix(publish): a stable release needs a maintainer's approval, not any account's (#8062)
* test(publish): a stable release counts only maintainers' reviews, never the approver's own push

* fix(publish): a stable release needs a maintainer's approval, not any account's

* fix(publish): only approvers and change requesters are looked up, and a failed lookup always refuses

* style(publish): the release gate's comments and lines fit the 120-character limit
2026-11-17 09:33:45 +00:00
Miguel Ángel 5f6007ffc4 ci: publish a stable release from the push that merges its release PR (#8020)
* ci: publish a stable release from the push that merges its release PR

* test(ci): read the publish job's own concurrency, where a publish in flight now waits

* ci: a stable release needs another person's approval of its final commit

* ci: only a person's approval counts for a stable release
2026-11-17 05:20:53 +00:00
Michael Wang 9fae4ffd81 ci(publish): a prerelease tag publishes only to an allow-listed dist-tag (#7963)
The publish job took the npm dist-tag from the pushed tag's suffix and refused
only an exact "latest". A tag such as v1.2.3-LATEST.1, or one with a new suffix,
still named its own dist-tag. The job's channel check now accepts only alpha,
beta, rc, next, canary, hdr, native and desktop, matched exactly.
2026-11-17 04:35:57 +00:00
Miguel Ángel a707e47379 docs(publish): say publishing waits for no approval and only admins push prerelease tags (#7960) 2026-11-16 18:37:38 +00:00
Miguel Ángel 5f46379775 fix(publish): upload only what npm reads as checked; tags publish only main, next or alpha commits (#7959)
* fix(publish): upload only what npm reads as checked, and tag-publish only main commits

npm reads tarballs with node-tar, which can resolve a header differently from the GNU tar
check. A dry run of the same npm now has to agree on name, version and files before anything
is written. A v*-* tag now builds only a commit already on main.

* fix(publish): a v*-* tag publishes a commit on main, next or alpha

Alphas stay cut from next or alpha as release-channels.mdx says; a commit on none of them is
refused before any job builds it, and the error names it as not an ancestor of those branches.

* style(publish): wrap the npm check comment under the 120-column limit
2026-11-16 17:13:42 +00:00
Miguel Ángel 9f85cf0a25 fix(publish): a first release attempt no longer fails looking for an artifact a retry would reuse (#7929) 2026-11-16 07:08:10 +00:00
Miguel Ángel dac0468f70 ci(publish): publish only tarballs npm reads the way the check does (#7922)
The publish job now refuses a packed tarball that holds anything but plain files
under package/ with one package/package.json, or whose publishConfig sets more
than access, registry, exports, main and types. npm publish pins the registry,
and a prerelease tag can no longer publish to the latest dist-tag.
2026-11-16 06:27:35 +00:00
Xuanru Li 8e8eeb2059 ci(publish): bind Lambda release retries to immutable run artifacts (#7920)
* ci(publish): reuse Lambda assets only from a release this run created (SECOPS-1217)

The pack job downloaded any Lambda handler zip or video image already on the release and pinned it
into @hyperframes/aws-lambda without checking where it came from, so anyone with contents write
could pre-stage both before a stable release.

A new step fails the run when the release exists but github-actions[bot] did not create it during
an earlier attempt of this run, or when a Lambda asset on it was uploaded by anyone else. The pin
steps reuse an asset only when that step allows it.

* fix: bind release retries to immutable run artifacts

* fix: fail release digest pipelines before side effects
2026-11-16 04:49:58 +00:00
Michael Wang 11a7d2749d ci(publish): the release keeps only Lambda assets npm pins or this run built (#7880)
The pack job no longer downloads Lambda assets already attached to the
release; it always pins the handler zip and video image this run built.

The publish job decides what the release keeps. Once
@hyperframes/aws-lambda is on npm for the version, the release must hold
exactly the assets that package pins. Before then, an asset this run did
not produce fails a first attempt, and a re-run of the same workflow run
replaces it. An asset identical to the bundle's is left alone, so a
re-run of only the publish job also works.
2026-11-16 03:45:25 +00:00
Miguel Ángel d9488119be fix(aws-lambda): the release ships the arm64 ffmpeg only when it matches its committed digest (#7872)
* fix(aws-lambda): the release ships the arm64 ffmpeg only when it matches its committed digest

* style(ci): format the release workflow tests
2026-11-16 01:09:58 +00:00
Michael Wang a54de748ee ci(publish): name npm-publish as the approval gate for every publish (#7870)
* ci(publish): publish prebuilt tarballs from a job that runs no release-commit code

Builds, lifecycle scripts and packing move to a pack job with a read-only
token and no secrets. The publish job, which holds the npm token and the
write token, checks each tarball's name and version against the release and
uploads it with lifecycle scripts off. A version already on npm with other
contents fails the first attempt instead of being skipped.

* ci(publish): prerelease tag pushes publish only after a maintainer approves

A prerelease tag can come from any prerelease branch, which no PR review
covers. Tag-push runs now use the npm-prerelease environment, which requires
a maintainer's approval. Merged release PRs keep the npm-publish environment.

* ci(publish): keep every publish in the approval-gated npm-publish environment

npm's trusted publishers are pinned to npm-publish, and that environment now
requires a maintainer's approval with self-review prevented. A second
environment would fail npm auth, so the workflow keeps npm-publish for every
trigger. The docs and test name it as the approval gate.
2026-11-16 00:04:25 +00:00
Michael Wang af0560c859 ci(publish): publish prebuilt tarballs from a job that runs no release-commit code (#7869)
Builds, lifecycle scripts and packing move to a pack job with a read-only
token and no secrets. The publish job, which holds the npm token and the
write token, checks each tarball's name and version against the release and
uploads it with lifecycle scripts off. A version already on npm with other
contents fails the first attempt instead of being skipped.
2026-11-15 23:21:03 +00:00
James RussoandClaude Opus 5.5 12d954a1fe ci(release): keep the publish job's write token out of the checkout (#7502)
The publish job's checkout persisted its contents:write token in
.git/config, where every later step, including the package install and
build, could read it. Check out without persisting credentials and give
the token only to "Create release tag", the one step that pushes. It
authenticates its own git calls through step-scoped GIT_CONFIG_* env and
masks the encoded value. The gh steps keep their own GH_TOKEN.

The workflow test now covers the checkout flag, which steps may receive
the token and under what name, the auth header the tag push actually
carries, and that nothing is written to .git/config.

— Rames Jusso

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:53:32 +00:00
James RussoandClaude Opus 5.5 265ec660b7 ci(publish): build the Lambda handler zip in a read-only job and verify its hash before release (#7495)
* ci(publish): build the Lambda handler zip in a read-only job and verify its hash before release

The handler zip build runs dependency install and bundling code. It moves out of the
publish job into its own job with `contents: read`, no secrets and no persisted git
credentials. The publish job downloads the artifact, checks its sha256 against the
build job's output, then pins and attaches it as before. A retried run still reuses
the zip already on the release.

Refs #7485

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(ci): cover the read-only Lambda zip build job and the pin step's hash check

The publish workflow test still looked for the old "Build Lambda handler zip"
step. It now checks the build job's read-only permissions and the publish job's
dependency on it, and runs the pin step for the retry, matching-hash,
mismatched-hash and empty-hash cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 14:42:13 +00:00
Miguel Ángel b501dc4e1b feat(cli): lambda deploy works from the npm install, no repo checkout (#5866)
* feat(cli): lambda deploy works from the npm install, no repo checkout

Each release builds the Lambda handler zip on Linux, attaches it to the
GitHub release, and pins its URL and sha256 (plus the SAM template) in
@hyperframes/aws-lambda before npm publish. Outside a checkout, lambda
deploy downloads that zip, refuses it on a sha256 mismatch, and deploys
it with the packaged template. With neither a checkout nor a pinned zip
it fails up front with one message naming every way out.

* fix(cli): lambda deploy test mocks the pinned-handler reader, comments fit the checks

* test(cli): sam tests deploy from a SAM directory, not the repo root

* chore(aws-lambda): raise the package size budget for the pinned handler template

Measured with pnpm@10.17.1 pack on Linux. Release state (prebuilt/ written by pin-handler-zip): 77,307 packed / 285,654 unpacked. CI state (no prebuilt/): 70,104 / 253,390. Packed is the check's 5% headroom over the release size. Unpacked is 292,000 (2.2% over release) because a 5% budget would put the CI pack under the 85% ratchet.

* test(cli): anchor the docs link check in the lambda deploy fallback test

* fix(cli): lambda deploy logs the verified handler sha256 and keeps a presigned query out of errors

* fix(cli): a redirect-limit download error keeps a signed query out of its message

* test(cli): the redirect-limit leak test types its rejection

* docs(aws-lambda): header comments cut to what the code cannot say

* chore(aws-lambda): size budget fits both the CI and the release package
2026-10-19 21:41:50 +00:00
James Russo d6191965cf fix: pin release publishing to merge commit (#2959) 2026-08-02 21:32:08 -07:00