Skip to content

Commit f8bdd52

Browse files
docs(README): add OIDC auth (#928)
* docs(README): update nodejs to conform new npm release process * docs(README): revert releaserc yml changes * docs(README): update yml files to fix release * docs(README): add verbose to releaserc yml * docs(README): remove tokens in nodejs yml * docs(README): revert whoami changes * docs(README): update auth token mechanism * docs(README): upgrade lerna * docs(README): upgrade lerna * docs(README): exchange token * docs(README): exchange token * docs(README): remove git reset * docs(README): add registry * docs(README): add registry * docs(README): add OIDC auth
1 parent 88f0b02 commit f8bdd52

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

.github/workflows/nodejs.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,20 @@ jobs:
6868
- run: yarn install --frozen-lockfile
6969
- run: yarn build
7070

71-
# Configure npm for OIDC (without token-based .npmrc from setup-node)
72-
- name: Configure npm registry
73-
run: npm config set registry https://registry.npmjs.org
74-
75-
- run: yarn run semantic-release
71+
- name: Run semantic-release
72+
id: semantic-release
73+
run: yarn run semantic-release
7674
env:
7775
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78-
# npm publish uses OIDC automatically with id-token: write permission
76+
77+
# npm publish runs directly in workflow step so OIDC works
78+
- name: Publish to npm with OIDC
79+
if: success()
80+
run: |
81+
# Check if any package was versioned (package.json was modified)
82+
if git diff --name-only HEAD~1 HEAD | grep -q "package.json"; then
83+
echo "Publishing packages to npm..."
84+
npm publish --workspaces --access public --provenance --registry https://registry.npmjs.org
85+
else
86+
echo "No version changes detected, skipping npm publish"
87+
fi

.releaserc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ plugins:
1818
- - '@semantic-release/changelog'
1919
- changelogTitle: "# Changelog\n\nAll notable changes to this project will be documented in this file."
2020
- - '@semantic-release/exec'
21-
- publishCmd: yarn lerna version ${nextRelease.version} --no-git-tag-version --no-push --yes --exact && npm publish --workspaces --access public --provenance --registry https://registry.npmjs.org
21+
- publishCmd: yarn lerna version ${nextRelease.version} --no-git-tag-version --no-push --yes --exact
2222
- '@semantic-release/github'
2323

2424
preset: conventionalcommits

0 commit comments

Comments
 (0)