Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ jobs:
run: corepack enable

- name: Use the reviewed npm release
run: npm install --global npm@11.18.0
run: npm install --global npm@11.18.0 --ignore-scripts --registry https://registry.npmjs.org/

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check release metadata
run: pnpm run release:check

- name: Check formatting
run: pnpm run format:check

Expand Down
339 changes: 307 additions & 32 deletions .github/workflows/publish.yml

Large diffs are not rendered by default.

34 changes: 19 additions & 15 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,25 @@ signed annotated `vX.Y.Z` tag at the exact `origin/main` commit, then run:
gh release create vX.Y.Z --verify-tag
```

The workflow runs `release:check` before preparation, and the packer, prepared
manifest verifier, registry decision, and minimal publisher independently
enforce the same `>=0.1.0` boundary.

The preparation job has no OIDC authority. It verifies the signer, tag,
release-event commit, main ancestry, complete gate, package inventory,
dependencies, audit, npm hashes, and clean-consumer import. It packs once.

The ordinary format, type, and test gate runs before `RELEASE_TAG`,
`RELEASE_PRERELEASE`, and `RELEASE_COMMIT` are introduced. Those release-event
variables are scoped only to the immediately following pack step, so a tagged
workflow cannot change the meaning of repository tests.

Only the final environment-scoped job receives `id-token: write`. It installs
no dependencies and publishes the exact prepared tarball with provenance.
Before either job reads repository files, workflow-owned commands validate the
stable tag syntax, event commit, annotated SSH signature, and containment in
protected main from a disposable bare repository. The preparation job then
checks out the verified commit by its exact object ID with stored credentials
disabled. It runs the metadata, format, type, and test gates before packing.

The packer removes prior build output and TypeScript incremental state, runs the
package build once with isolated npm configuration, and packs those exact files
with lifecycle scripts disabled. It records SHA-256 and SHA-512 digests,
requires the exact two-file release directory, checks the package inventory and
dependencies, and imports the tarball from a clean consumer. Empty private npm
configuration files and a fresh working directory isolate each npm operation.

Only the final environment-scoped job receives `id-token: write`. It never
checks out repository contents and does not execute package scripts. Its
workflow-owned validation repeats the tag checks, requires the exact manifest
and tarball file inventory, validates the manifest identity and commit, and
recomputes both digests before publishing the absolute tarball path with
provenance and lifecycle scripts disabled.

## Registry safety

Expand Down
8 changes: 4 additions & 4 deletions docs/securityscan.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ evidence, exploitability assessment, and file references.
- **[OK] `.github/workflows/*.yml`** — reviewed. All actions pinned by full
commit SHA, least-privilege `permissions`
(`contents: read`, with `id-token: write` only in the publish job), no
`pull_request_target`, no script injection from event context (release tag
used only as a `ref` string and in artifact names, not interpolated into
shell), protected-environment gate (`environment: npm-publish`). No findings
yet.
`pull_request_target`; release values pass through scoped environment
variables and canonical validation before quoted refspec use; prepared files
are checked by workflow-owned logic covered by executable tests; and the
protected-environment gate is `environment: npm-publish`. No findings yet.
- **[OK] `test/azurite.ts`** — reviewed. Local emulator harness; binds to
127.0.0.1, spawns node with fixed args, no secrets. No findings.

Expand Down
5 changes: 5 additions & 0 deletions scripts/release-packages.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export function publicRegistryArguments(
arguments_: readonly string[],
registry?: string,
): string[];
export function resolveNpmCli(): string;
export function parseArguments(
arguments_: readonly string[],
): ValidationOptions;
Expand All @@ -55,6 +56,10 @@ export function validateRepository(
): Promise<unknown>;
export function verifyPreparedManifest(path: string): Promise<unknown>;
export function verifyPreparedBootstrapManifest(path: string): Promise<unknown>;
export function verifyReleaseDirectory(
directory: string,
expectedTarball?: string,
): Promise<{ tarball: string }>;
export function verifyBootstrapPreparation(
options?: ValidationOptions,
): Promise<unknown>;
Expand Down
Loading
Loading