Skip to content

Commit f95a617

Browse files
authored
Merge pull request #19 from sjsjsj1246/codex/use-trusted-publishing
[-]: trusted publishing 전환
2 parents e8ec723 + 7c79649 commit f95a617

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
permissions:
1313
contents: write
14+
id-token: write
1415
pull-requests: write
1516

1617
steps:
@@ -24,10 +25,10 @@ jobs:
2425
with:
2526
version: 10.12.4
2627

27-
- name: Use Node.js 20
28+
- name: Use Node.js 22
2829
uses: actions/setup-node@v4
2930
with:
30-
node-version: 20
31+
node-version: 22
3132
cache: pnpm
3233
registry-url: https://registry.npmjs.org
3334

@@ -43,4 +44,3 @@ jobs:
4344
commit: "[-]: version packages"
4445
env:
4546
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

docs/releasing.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ This repository now uses [Changesets](https://github.com/changesets/changesets)
44

55
## One-time setup
66

7-
The GitHub release workflow expects an `NPM_TOKEN` repository secret with publish access to the `react-tutorial-overlay` npm package.
7+
This repository uses npm Trusted Publishing for GitHub Actions.
8+
9+
Set up once on npm:
10+
11+
1. Open the `react-tutorial-overlay` package settings on npm.
12+
2. Add a Trusted Publisher for the `sjsjsj1246/react-tutorial-overlay` GitHub repository.
13+
3. Set the workflow filename to `release.yml`.
14+
15+
After that, the GitHub release workflow can publish without storing a long-lived `NPM_TOKEN` secret.
816

917
## Everyday workflow
1018

@@ -65,6 +73,7 @@ On pushes to `main` or manual dispatch, `.github/workflows/release.yml` runs `ch
6573
- If unreleased changesets exist, it opens or updates a release PR.
6674
- If the release PR has already been merged and version files are on `main`, it runs `pnpm release`.
6775
- `pnpm release` verifies tests, docs lint/build, size limits, and then runs `changeset publish`.
76+
- Publishing uses GitHub Actions OIDC via npm Trusted Publishing instead of an `NPM_TOKEN` secret.
6877

6978
## Notes for this repo
7079

0 commit comments

Comments
 (0)