Skip to content

Commit da978ec

Browse files
authored
chore(ci-cd): changes to publish package via trusted oidc method (#270)
discontinue using tokens to publish GH-269
1 parent 56a7d30 commit da978ec

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

.github/workflows/release.yaml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ name: Release [Manual]
44
on: workflow_dispatch
55
permissions:
66
contents: write
7+
id-token: write # required for trusted publishing
78
jobs:
89
Release:
910
runs-on: ubuntu-latest
@@ -27,15 +28,15 @@ jobs:
2728
GITHUB_PAT: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
2829
CONFIG_USERNAME: ${{ vars.RELEASE_COMMIT_USERNAME }}
2930
CONFIG_EMAIL: ${{ vars.RELEASE_COMMIT_EMAIL }}
30-
- name: Authenticate with Registry
31-
run: |
32-
echo "@${NPM_USERNAME}:registry=https://registry.npmjs.org/" > .npmrc
33-
echo "registry=https://registry.npmjs.org/" >> .npmrc
34-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
35-
npm whoami
36-
env:
37-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
38-
NPM_USERNAME: ${{ vars.NPM_USERNAME }}
31+
# - name: Authenticate with Registry
32+
# run: |
33+
# echo "@${NPM_USERNAME}:registry=https://registry.npmjs.org/" > .npmrc
34+
# echo "registry=https://registry.npmjs.org/" >> .npmrc
35+
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
36+
# npm whoami
37+
# env:
38+
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
39+
# NPM_USERNAME: ${{ vars.NPM_USERNAME }}
3940

4041
- name: Install 📌
4142
run: |
@@ -44,9 +45,12 @@ jobs:
4445
run: npm run test
4546
- name: Semantic Publish to NPM 🚀
4647
# "HUSKY=0" disables pre-commit-msg check (Needed in order to allow semantic-release perform the release commit)
47-
run: HUSKY=0 npx semantic-release
48+
run: |
49+
npm config set provenance true
50+
HUSKY=0 npx semantic-release
4851
env:
4952
GH_TOKEN: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
50-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53+
# npm token not needed got trusted publishing
54+
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5155
- name: Changelog 📝
5256
run: cd src/release_notes && HUSKY=0 node release-notes.js

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "loopback4-authentication",
33
"version": "13.0.0",
4-
"description": "A loopback-next extension for authentication feature. Various Oauth strategies supported.",
4+
"description": "A loopback-next extension for authentication feature. Various Oauth strategies supported by this package.",
55
"keywords": [
66
"loopback-extension",
77
"loopback",

0 commit comments

Comments
 (0)