Skip to content

Commit 9857cc3

Browse files
committed
fix: update npm publish workflow
- Update actions/checkout@v2 to v3 - Update actions/setup-node@v2 to v3 - Change fetch-depth to ref for consistency - Update to KRAKENJS_PAYPAL_SDK_NPM_AUTH_TOKEN secret - Add workflow_dispatch documentation - Update publish step name
1 parent a54b37e commit 9857cc3

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1+
# manually run this action using the GitHub UI
2+
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
13
name: publish to npm
24
on: workflow_dispatch
35
jobs:
46
main:
57
runs-on: ubuntu-latest
68
steps:
79
- name: ⬇️ Checkout repo
8-
uses: actions/checkout@v2
10+
uses: actions/checkout@v3
911
with:
10-
fetch-depth: 0
12+
ref: ${{ github.head_ref }}
1113

1214
- name: ⎔ Setup node
1315
# sets up the .npmrc file to publish to npm
14-
uses: actions/setup-node@v2
16+
uses: actions/setup-node@v3
1517
with:
1618
node-version: "16"
1719
registry-url: "https://registry.npmjs.org"
@@ -25,7 +27,9 @@ jobs:
2527
run: |
2628
git config --global user.email ${{ github.actor }}@users.noreply.github.com
2729
git config --global user.name ${{ github.actor }}
28-
- name: Publish to npm
30+
- name: 📦 Publish to npm using existing scripts
2931
run: npm run release
3032
env:
31-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
33+
# actions/setup-node uses this NODE_AUTH_TOKEN environment variable for npm publishing
34+
# https://docs.github.com/en/actions/tutorials/publish-packages/publish-nodejs-packages
35+
NODE_AUTH_TOKEN: ${{ secrets.KRAKENJS_PAYPAL_SDK_NPM_AUTH_TOKEN }}

0 commit comments

Comments
 (0)