Skip to content

Commit 5eea769

Browse files
Make the workflow push to GitHub instead of NPM
1 parent 687e366 commit 5eea769

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/package.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
name: Publish Package to npmjs
1+
name: Publish package to GitHub Packages
22
on:
33
release:
44
types: [created]
55
jobs:
66
build:
7-
runs-on: ubuntu-latest
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
packages: write
811
steps:
912
- uses: actions/checkout@v2
10-
# Setup .npmrc file to publish to npm
13+
# Setup .npmrc file to publish to GitHub Packages
1114
- uses: actions/setup-node@v2
1215
with:
1316
node-version: '16.x'
14-
registry-url: 'https://registry.npmjs.org'
17+
registry-url: 'https://npm.pkg.github.com'
18+
# Defaults to the user or organization that owns the workflow file
19+
scope: '@octocat'
1520
- run: npm ci
1621
- run: npm publish
1722
env:
18-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
23+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)