Skip to content

Commit 05cc3c9

Browse files
committed
fix: github action with new mpmjs auth policy
1 parent bef8a4a commit 05cc3c9

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

.github/workflows/node.js.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref_name }}
1414
cancel-in-progress: true
1515

16-
permissions:
17-
id-token: write
18-
1916
jobs:
2017
build:
2118
runs-on: ubuntu-latest
@@ -64,6 +61,9 @@ jobs:
6461
runs-on: ubuntu-latest
6562
if: github.ref == 'refs/heads/master'
6663
needs: build
64+
permissions:
65+
contents: write
66+
id-token: write
6767
steps:
6868
- uses: actions/checkout@v4
6969
with:
@@ -78,12 +78,9 @@ jobs:
7878
- run: yarn build
7979
- run: git update-index --assume-unchanged package.json
8080
- name: Install lerna globally
81-
run: npm install --global --loglevel=error lerna@6.6.1
81+
run: npm install --global --loglevel=error lerna@latest
8282
- name: Authenticate with Registry and publish
8383
run: |
84-
yarn logout
85-
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > .npmrc
86-
npm whoami
87-
lerna publish --no-verify-access -c -y --pre-dist-tag next --preid $(git rev-parse --short HEAD) --force-publish=*
88-
env:
89-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
84+
# No manual .npmrc creation or 'npm whoami' needed.
85+
# Lerna v9+ automatically detects the OIDC environment.
86+
lerna publish --no-verify-access -c -y --pre-dist-tag next --preid $(git rev-parse --short HEAD) --force-publish=*

0 commit comments

Comments
 (0)