Repository navigation
Refine release preparation and publication #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,47 +17,75 @@ concurrency: | |
| jobs: | ||
| prepare: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| manifest_digest: ${{ steps.manifest.outputs.digest }} | ||
| env: | ||
| RELEASE_TAG: ${{ github.event.release.tag_name }} | ||
| RELEASE_PRERELEASE: ${{ github.event.release.prerelease }} | ||
| RELEASE_COMMIT: ${{ github.sha }} | ||
| RELEASE_ALLOWED_SIGNERS: ${{ vars.RELEASE_ALLOWED_SIGNERS }} | ||
|
|
||
| steps: | ||
| - name: Check out the release tag | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| ref: refs/tags/${{ github.event.release.tag_name }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Fetch the protected release branch | ||
| run: git fetch --no-tags origin main:refs/remotes/origin/main | ||
|
|
||
| - name: Configure approved release signers | ||
| - name: Authenticate the release tag | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| if [[ "${RELEASE_PRERELEASE}" != "false" ]]; then | ||
| echo "::error::Only stable releases may publish packages" | ||
| exit 1 | ||
| fi | ||
| if [[ ! "${RELEASE_TAG}" =~ ^v(0\.[1-9][0-9]*|[1-9][0-9]*\.[0-9]+)\.[0-9]+$ ]]; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 Tag-format authority duplicated as a bash regex that rejects v0.0.x ( The workflow's bash regex Proof gap:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The normal release lane intentionally rejects the complete 0.0.x bootstrap range, as documented in RELEASING.md and enforced by isNormalReleaseVersion. The workflow expression matches that established release contract. |
||
| echo "::error::RELEASE_TAG must be a stable supported version" | ||
| exit 1 | ||
| fi | ||
| if [[ ! "${RELEASE_COMMIT}" =~ ^[0-9a-fA-F]{40}$ ]]; then | ||
| echo "::error::RELEASE_COMMIT must be an exact commit" | ||
| exit 1 | ||
| fi | ||
| if [[ -z "${RELEASE_ALLOWED_SIGNERS}" ]]; then | ||
| echo "::error::RELEASE_ALLOWED_SIGNERS must contain the reviewed SSH allowed-signers entries" | ||
| echo "::error::RELEASE_ALLOWED_SIGNERS must contain reviewed entries" | ||
| exit 1 | ||
| fi | ||
| allowed_signers="${RUNNER_TEMP}/release-allowed-signers" | ||
| release_repo="$(mktemp -d "${RUNNER_TEMP}/release-git.XXXXXX")" | ||
| trap 'rm -rf "${release_repo}"' EXIT | ||
| git init --bare "${release_repo}" | ||
| git -C "${release_repo}" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" | ||
| allowed_signers="${release_repo}/allowed-signers" | ||
|
FlyOverCoderKY marked this conversation as resolved.
Resolved
|
||
| umask 077 | ||
| printf '%s\n' "${RELEASE_ALLOWED_SIGNERS}" > "${allowed_signers}" | ||
| git config --local gpg.format ssh | ||
| git config --local gpg.ssh.allowedSignersFile "${allowed_signers}" | ||
| chmod 0600 "${allowed_signers}" | ||
| git -C "${release_repo}" config gpg.format ssh | ||
| git -C "${release_repo}" config gpg.ssh.allowedSignersFile "${allowed_signers}" | ||
| git -C "${release_repo}" fetch --no-tags origin \ | ||
| refs/heads/main:refs/remotes/origin/main \ | ||
| "+refs/tags/${RELEASE_TAG}:refs/tags/${RELEASE_TAG}" | ||
| [[ "$(git -C "${release_repo}" cat-file -t "refs/tags/${RELEASE_TAG}")" == "tag" ]] | ||
| git -C "${release_repo}" verify-tag "refs/tags/${RELEASE_TAG}" | ||
| tag_commit="$(git -C "${release_repo}" rev-parse "refs/tags/${RELEASE_TAG}^{commit}")" | ||
| [[ "${tag_commit}" == "${RELEASE_COMMIT,,}" ]] | ||
| git -C "${release_repo}" merge-base --is-ancestor \ | ||
| "${RELEASE_COMMIT}" refs/remotes/origin/main | ||
|
|
||
| - name: Check out the release commit | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| ref: ${{ github.sha }} | ||
| persist-credentials: false | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up pnpm | ||
| uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 | ||
| with: | ||
| version: 10.34.5 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 | ||
| with: | ||
| node-version: 24.18.0 | ||
| registry-url: https://registry.npmjs.org | ||
| package-manager-cache: false | ||
|
|
||
| - name: Enable Corepack | ||
| run: corepack enable | ||
| cache: pnpm | ||
|
|
||
| - 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 | ||
|
|
@@ -71,56 +99,261 @@ jobs: | |
| - name: Run tests | ||
| run: pnpm test | ||
|
|
||
| - name: Prepare and verify release tarballs | ||
| run: pnpm run release:pack -- --require-clean --require-main-ancestor --require-release-tag --expected-release-commit "${RELEASE_COMMIT}" --output .release | ||
| - name: Prepare release tarballs | ||
| run: pnpm run release:pack -- --require-clean --output .release | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 release:pack invoked without tag flags; manifest.releaseTag population in CI unverified ( Every stable release could fail at the publish job if tag detection in the pack script is gated on the flags this PR removed. The prepare step now runs Proof gap: the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. RELEASE_TAG is read unconditionally from the job environment during repository validation, so package-manifest.json receives the tag without this flag. require-release-tag only enables checkout-based tag verification, which is intentionally replaced by the earlier bare-repository check. |
||
|
|
||
| - name: Record the package manifest digest | ||
| id: manifest | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| digest="$(sha256sum .release/package-manifest.json | cut -d ' ' -f 1)" | ||
| [[ "${digest}" =~ ^[0-9a-f]{64}$ ]] | ||
| printf 'digest=%s\n' "${digest}" >> "${GITHUB_OUTPUT}" | ||
|
|
||
| - name: Upload the prepared release | ||
| id: upload | ||
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | ||
| with: | ||
| name: scheduler-release-${{ github.run_id }} | ||
| path: .release/ | ||
| if-no-files-found: error | ||
| include-hidden-files: true | ||
| include-hidden-files: false | ||
| overwrite: true | ||
| retention-days: 30 | ||
|
|
||
| - name: Record the prepared artifact digest | ||
| run: echo "Prepared artifact SHA-256 ${{ steps.upload.outputs.artifact-digest }}" >> "${GITHUB_STEP_SUMMARY}" | ||
| smoke: | ||
| needs: prepare | ||
| runs-on: ubuntu-latest | ||
|
FlyOverCoderKY marked this conversation as resolved.
Resolved
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 | ||
| with: | ||
| node-version: 24.18.0 | ||
| package-manager-cache: false | ||
|
|
||
| - name: Use the reviewed npm release | ||
| run: npm install --global npm@11.18.0 --ignore-scripts --registry https://registry.npmjs.org/ | ||
|
|
||
| - name: Download the prepared release | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: scheduler-release-${{ github.run_id }} | ||
| path: .release | ||
|
|
||
| - name: Install and import the prepared packages | ||
| shell: bash | ||
| env: | ||
| MANIFEST_DIGEST: ${{ needs.prepare.outputs.manifest_digest }} | ||
| run: | | ||
| set -euo pipefail | ||
| smoke_dir="$(mktemp -d "${RUNNER_TEMP}/release-smoke.XXXXXX")" | ||
| trap 'rm -rf "${smoke_dir}"' EXIT | ||
| printf '%s\n' '{"name":"release-smoke","private":true,"type":"module"}' > "${smoke_dir}/package.json" | ||
| release_manifest="${GITHUB_WORKSPACE}/.release/package-manifest.json" | ||
| tarball_list="${RUNNER_TEMP}/release-tarballs" | ||
| export RELEASE_MANIFEST="${release_manifest}" | ||
| node --input-type=module > "${tarball_list}" <<'NODE' | ||
| import { createHash, timingSafeEqual } from "node:crypto"; | ||
| import { readFile } from "node:fs/promises"; | ||
| import { dirname, resolve } from "node:path"; | ||
| const equal = (left, right) => { | ||
| const a = Buffer.from(left); | ||
| const b = Buffer.from(right); | ||
| return a.length === b.length && timingSafeEqual(a, b); | ||
| }; | ||
| const manifestBytes = await readFile(process.env.RELEASE_MANIFEST); | ||
| const digest = createHash("sha256").update(manifestBytes).digest("hex"); | ||
| if (!equal(digest, process.env.MANIFEST_DIGEST ?? "")) throw new Error("package manifest digest does not match"); | ||
| const manifest = JSON.parse(manifestBytes.toString("utf8")); | ||
| if (!Array.isArray(manifest.packages) || manifest.packages.length === 0) throw new Error("package manifest inventory is invalid"); | ||
| for (const record of manifest.packages) { | ||
| if (!Array.isArray(record.imports) || record.imports.length === 0) throw new Error(`${record.name} import inventory is invalid`); | ||
| const tarball = resolve(dirname(process.env.RELEASE_MANIFEST), record.tarball); | ||
| const bytes = await readFile(tarball); | ||
| const sha256 = createHash("sha256").update(bytes).digest("hex"); | ||
| const integrity = `sha512-${createHash("sha512").update(bytes).digest("base64")}`; | ||
| if (!equal(sha256, record.sha256) || !equal(integrity, record.integrity)) throw new Error(`${record.name} package digest does not match`); | ||
| console.log(tarball); | ||
| } | ||
| NODE | ||
| mapfile -t tarballs < "${tarball_list}" | ||
| [[ "${#tarballs[@]}" -gt 0 ]] | ||
| npm install --prefix "${smoke_dir}" --ignore-scripts --no-audit --no-fund \ | ||
|
FlyOverCoderKY marked this conversation as resolved.
Resolved
|
||
| --package-lock=false --registry https://registry.npmjs.org/ "${tarballs[@]}" | ||
| cd "${smoke_dir}" | ||
| node --input-type=module <<'NODE' | ||
| import { readFile } from "node:fs/promises"; | ||
| const manifest = JSON.parse(await readFile(process.env.RELEASE_MANIFEST, "utf8")); | ||
| for (const record of manifest.packages) { | ||
| for (const specifier of record.imports) await import(specifier); | ||
| } | ||
| NODE | ||
|
|
||
| publish: | ||
| needs: prepare | ||
| needs: [prepare, smoke] | ||
| runs-on: ubuntu-latest | ||
| environment: npm-publish | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| env: | ||
| RELEASE_TAG: ${{ github.event.release.tag_name }} | ||
| RELEASE_PRERELEASE: ${{ github.event.release.prerelease }} | ||
| RELEASE_COMMIT: ${{ github.sha }} | ||
| RELEASE_ALLOWED_SIGNERS: ${{ vars.RELEASE_ALLOWED_SIGNERS }} | ||
|
|
||
| steps: | ||
| - name: Check out the exact release tag | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| ref: refs/tags/${{ github.event.release.tag_name }} | ||
| fetch-depth: 1 | ||
| - name: Authenticate the release tag | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| if [[ "${RELEASE_PRERELEASE}" != "false" ]]; then | ||
| echo "::error::Only stable releases may publish packages" | ||
| exit 1 | ||
| fi | ||
| if [[ ! "${RELEASE_TAG}" =~ ^v(0\.[1-9][0-9]*|[1-9][0-9]*\.[0-9]+)\.[0-9]+$ ]]; then | ||
| echo "::error::RELEASE_TAG must be a stable supported version" | ||
| exit 1 | ||
| fi | ||
| if [[ ! "${RELEASE_COMMIT}" =~ ^[0-9a-fA-F]{40}$ ]]; then | ||
| echo "::error::RELEASE_COMMIT must be an exact commit" | ||
| exit 1 | ||
| fi | ||
| if [[ -z "${RELEASE_ALLOWED_SIGNERS}" ]]; then | ||
| echo "::error::RELEASE_ALLOWED_SIGNERS must contain reviewed entries" | ||
| exit 1 | ||
| fi | ||
| release_repo="$(mktemp -d "${RUNNER_TEMP}/release-git.XXXXXX")" | ||
| trap 'rm -rf "${release_repo}"' EXIT | ||
| git init --bare "${release_repo}" | ||
| git -C "${release_repo}" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" | ||
| allowed_signers="${release_repo}/allowed-signers" | ||
| umask 077 | ||
| printf '%s\n' "${RELEASE_ALLOWED_SIGNERS}" > "${allowed_signers}" | ||
| chmod 0600 "${allowed_signers}" | ||
| git -C "${release_repo}" config gpg.format ssh | ||
| git -C "${release_repo}" config gpg.ssh.allowedSignersFile "${allowed_signers}" | ||
| git -C "${release_repo}" fetch --no-tags origin \ | ||
| refs/heads/main:refs/remotes/origin/main \ | ||
| "+refs/tags/${RELEASE_TAG}:refs/tags/${RELEASE_TAG}" | ||
| [[ "$(git -C "${release_repo}" cat-file -t "refs/tags/${RELEASE_TAG}")" == "tag" ]] | ||
| git -C "${release_repo}" verify-tag "refs/tags/${RELEASE_TAG}" | ||
| tag_commit="$(git -C "${release_repo}" rev-parse "refs/tags/${RELEASE_TAG}^{commit}")" | ||
| [[ "${tag_commit}" == "${RELEASE_COMMIT,,}" ]] | ||
| git -C "${release_repo}" merge-base --is-ancestor \ | ||
| "${RELEASE_COMMIT}" refs/remotes/origin/main | ||
|
|
||
| - name: Set up Node.js and the npm registry | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 | ||
| with: | ||
| node-version: 24.18.0 | ||
| registry-url: https://registry.npmjs.org | ||
| package-manager-cache: false | ||
|
|
||
| - 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: Download the prepared release | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: scheduler-release-${{ github.run_id }} | ||
| path: .release | ||
|
|
||
| - name: Publish verified prepared tarballs | ||
| run: node scripts/release-packages.mjs publish --expected-release-commit "${RELEASE_COMMIT}" --manifest .release/package-manifest.json | ||
| - name: Verify and publish the prepared packages | ||
| env: | ||
| MANIFEST_DIGEST: ${{ needs.prepare.outputs.manifest_digest }} | ||
| run: | | ||
| node --input-type=module <<'NODE' | ||
| import { spawnSync } from "node:child_process"; | ||
| import { createHash, timingSafeEqual } from "node:crypto"; | ||
| import { lstat, mkdtemp, readFile, readdir, writeFile } from "node:fs/promises"; | ||
| import { tmpdir } from "node:os"; | ||
| import { resolve } from "node:path"; | ||
|
|
||
| const fail = (message) => { throw new Error(message); }; | ||
| const equal = (left, right) => { | ||
| const a = Buffer.from(left); | ||
| const b = Buffer.from(right); | ||
| return a.length === b.length && timingSafeEqual(a, b); | ||
| }; | ||
| const releaseDirectory = resolve(".release"); | ||
| const manifestPath = resolve(releaseDirectory, "package-manifest.json"); | ||
| const manifestBytes = await readFile(manifestPath); | ||
| const digest = createHash("sha256").update(manifestBytes).digest("hex"); | ||
| if (!equal(digest, process.env.MANIFEST_DIGEST ?? "")) fail("package manifest digest does not match"); | ||
| const manifest = JSON.parse(manifestBytes.toString("utf8")); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 Two-package inventory hardcoded in workflow smoke imports, publish script, and docs ( Adding a third package to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dbbd90c removes hardcoded smoke imports by consuming the sealed import inventory. The publication job intentionally retains the reviewed two-package allowlist required for this repository; adding a package must update that explicit release boundary and fail closed until reviewed. |
||
| const names = ["@pegma/scheduler", "@pegma/scheduler-cloudflare"]; | ||
| const releaseCommit = (process.env.RELEASE_COMMIT ?? "").toLowerCase(); | ||
| if (manifest.schemaVersion !== 1 || manifest.gitCommit !== releaseCommit || | ||
| manifest.releaseTag !== process.env.RELEASE_TAG || !Array.isArray(manifest.packages) || | ||
| JSON.stringify(manifest.packages.map(({ name }) => name)) !== JSON.stringify(names)) { | ||
| fail("package manifest inventory is invalid"); | ||
| } | ||
| const expectedFiles = ["package-manifest.json"]; | ||
| const directories = ["scheduler", "scheduler-cloudflare"]; | ||
| for (const [index, record] of manifest.packages.entries()) { | ||
|
FlyOverCoderKY marked this conversation as resolved.
Resolved
|
||
| const expectedTarball = `${names[index].slice(1).replace("/", "-")}-${record.version}.tgz`; | ||
| if (record.directory !== directories[index] || record.tarball !== expectedTarball || | ||
| !/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/.test(record.version) || | ||
| record.publish !== (record.version === manifest.releaseTag.slice(1)) || | ||
| !/^[0-9a-f]{64}$/.test(record.sha256) || !/^[0-9a-f]{40}$/.test(record.shasum) || | ||
| !/^sha512-[A-Za-z0-9+/]+={0,2}$/.test(record.integrity) || | ||
| !Array.isArray(record.files) || !Array.isArray(record.imports) || record.imports.length === 0) { | ||
| fail(`${record.name} package metadata is invalid`); | ||
| } | ||
| expectedFiles.push(record.tarball); | ||
| } | ||
| const entries = await readdir(releaseDirectory, { withFileTypes: true }); | ||
| if (JSON.stringify(entries.map(({ name }) => name).sort()) !== JSON.stringify(expectedFiles.sort())) { | ||
| fail("release artifact inventory is invalid"); | ||
| } | ||
| for (const entry of entries) { | ||
| const metadata = await lstat(resolve(releaseDirectory, entry.name)); | ||
| if (entry.name.startsWith(".") || !entry.isFile() || !metadata.isFile() || metadata.isSymbolicLink()) { | ||
| fail("release artifact entries must be regular visible files"); | ||
| } | ||
| } | ||
| for (const record of manifest.packages) { | ||
| const tarball = resolve(releaseDirectory, record.tarball); | ||
|
FlyOverCoderKY marked this conversation as resolved.
Resolved
|
||
| const bytes = await readFile(tarball); | ||
| const sha256 = createHash("sha256").update(bytes).digest("hex"); | ||
| const shasum = createHash("sha1").update(bytes).digest("hex"); | ||
| const integrity = `sha512-${createHash("sha512").update(bytes).digest("base64")}`; | ||
| if (!equal(sha256, record.sha256) || !equal(shasum, record.shasum) || | ||
| !equal(integrity, record.integrity)) { | ||
| fail(`${record.name} package digest does not match`); | ||
| } | ||
| } | ||
|
|
||
| const publishDirectory = await mkdtemp(resolve(process.env.RUNNER_TEMP ?? tmpdir(), "npm-publish.")); | ||
| const configDirectory = await mkdtemp(resolve(process.env.RUNNER_TEMP ?? tmpdir(), "npm-config.")); | ||
| const userConfig = resolve(configDirectory, "userconfig"); | ||
| const globalConfig = resolve(configDirectory, "globalconfig"); | ||
| await writeFile(userConfig, "", { mode: 0o600 }); | ||
| await writeFile(globalConfig, "", { mode: 0o600 }); | ||
| const environment = Object.fromEntries(Object.entries(process.env).filter(([key]) => | ||
| ["CI", "PATH", "HOME", "RUNNER_TEMP", "SYSTEMROOT"].includes(key) || key.startsWith("TMP") || | ||
| key.startsWith("GITHUB_") || key.startsWith("ACTIONS_ID_TOKEN_"))); | ||
| environment.NPM_CONFIG_USERCONFIG = userConfig; | ||
| environment.NPM_CONFIG_GLOBALCONFIG = globalConfig; | ||
| const npm = (args, allowMissing = false) => { | ||
| const result = spawnSync("npm", args, { cwd: publishDirectory, encoding: "utf8", env: environment }); | ||
| if (result.error) throw result.error; | ||
| if (result.status !== 0 && !(allowMissing && /\bE404\b/.test(`${result.stdout}\n${result.stderr}`))) { | ||
| fail(`npm ${args[0]} failed: ${result.stderr.trim()}`); | ||
| } | ||
| return result; | ||
| }; | ||
| for (const record of manifest.packages.filter(({ publish }) => publish)) { | ||
| const specifier = `${record.name}@${record.version}`; | ||
| const viewed = npm(["view", specifier, "dist.integrity", "--json", "--registry", "https://registry.npmjs.org/", "--ignore-scripts"], true); | ||
| if (viewed.status === 0) { | ||
| const registryIntegrity = JSON.parse(viewed.stdout); | ||
| if (!equal(registryIntegrity, record.integrity)) fail(`${specifier} registry digest differs`); | ||
| continue; | ||
| } | ||
| npm(["publish", resolve(releaseDirectory, record.tarball), "--tag", "latest", "--registry", "https://registry.npmjs.org/", "--access", "public", "--provenance", "--ignore-scripts"]); | ||
| } | ||
| NODE | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔵 Duplicate tag-authentication Bash blocks (
nit)Concrete failure: Identical 30-line
Authenticate the release tagBash is duplicated inprepareandpublish. A future edit that updates one block (e.g., regex,allowed_signershandling) and not the other silently desynchronizes the two gates, allowing a tag that passesprepareto fail (or worse, pass with weaker checks) inpublish.Evidence:
publish.yml:29-64andpublish.yml:172-210are verbatim copies except for env. No shared composite action oruses:abstraction.Checked: Full
publish.ymlviaread_file;tests/publish-workflow.test.ts:11-33asserts both contain the same strings but cannot prevent drift.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping both checks inline is intentional: prepare must authenticate before checkout, while publish must authenticate without any checkout. Moving this logic into repository files would cross those execution boundaries; structure tests assert the complete checks in both jobs.