Skip to content

Commit 215ce4f

Browse files
authored
fix(release): restore package token fallback (#185)
1 parent 2dd0e23 commit 215ce4f

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -727,11 +727,9 @@ jobs:
727727
728728
- name: Publish only certified tarballs
729729
env:
730-
CODEGRAPH_PACKAGES_TOKEN_B64: ${{ secrets.CODEGRAPH_PACKAGES_TOKEN_B64 }}
730+
NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_PUBLISH_TOKEN || secrets.GITHUB_TOKEN }}
731731
shell: bash
732732
run: |
733-
export NODE_AUTH_TOKEN="$(printf '%s' "$CODEGRAPH_PACKAGES_TOKEN_B64" | base64 --decode)"
734-
echo "::add-mask::$NODE_AUTH_TOKEN"
735733
node ./scripts/certification/publish-release-candidates.mjs \
736734
--manifest temp/release-candidates/release-candidate-manifest.json \
737735
--expected-source-revision ${{ needs.plan-release.outputs.source_revision }} \

PUBLISHING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ A structural result proves archive checksum, package identity, target naming, an
9999

100100
Publishing waits for every required package row plus security, semantics, and hermeticity. Missing, failed, stale-revision, wrong-version, expired-exception, size, or checksum evidence stops the job before `npm publish` is invoked.
101101

102-
The workflow uses the `CODEGRAPH_PACKAGES_TOKEN_B64` Actions secret, which must contain a base64-encoded classic PAT that can write the `@lzehrung` packages.
102+
The workflow uses `PACKAGE_PUBLISH_TOKEN` when configured and otherwise uses the workflow-scoped `GITHUB_TOKEN`. The job has `packages: write`; a custom token is only needed when the repository's workflow token cannot write an existing package.
103103

104104
## Package Roles
105105

tests/certification-release-workflow.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ describe("certified release workflows", () => {
5656
expect(releaseWorkflow.split("assemble-release-candidates.mjs")).toHaveLength(2);
5757
expect(releaseWorkflow).not.toContain("npm pack");
5858
expect(publish).toContain("publish-release-candidates.mjs");
59-
expect(publish).toContain("CODEGRAPH_PACKAGES_TOKEN_B64: ${{ secrets.CODEGRAPH_PACKAGES_TOKEN_B64 }}");
60-
expect(publish).toContain("base64 --decode");
59+
expect(publish).toContain("NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_PUBLISH_TOKEN || secrets.GITHUB_TOKEN }}");
60+
expect(publish).not.toContain("CODEGRAPH_PACKAGES_TOKEN_B64");
61+
expect(publish).not.toContain("base64 --decode");
6162
expect(publish).toContain("temp/release-candidates/packages/*.tgz");
6263
expect(publish).toContain("temp/release-candidates/SHA256SUMS");
6364
expect(publish).toContain("release-candidate-manifest.json");

0 commit comments

Comments
 (0)