Skip to content

Commit a966779

Browse files
committed
fix: refine GitHub Packages workflow by adjusting permissions and simplifying npm publish steps
1 parent cd3ce1e commit a966779

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.github/workflows/publish.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
jobs:
88
publish-npm:
99
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
packages: write
1013
steps:
1114
- uses: actions/checkout@v4
1215
- uses: actions/setup-node@v4
@@ -33,12 +36,8 @@ jobs:
3336
scope: '@pedroab0'
3437
- run: npm ci
3538
- name: Configure for GitHub Packages
36-
run: |
37-
npm pkg set name="@pedroab0/swr-catalyst"
38-
echo "Checking .npmrc location: $NPM_CONFIG_USERCONFIG"
39-
cat $NPM_CONFIG_USERCONFIG
40-
echo "Modified package.json name:"
41-
npm pkg get name
42-
- run: npm publish --verbose
39+
run: npm pkg set name="@pedroab0/swr-catalyst"
40+
- run: npm test
41+
- run: npm publish
4342
env:
4443
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)