Skip to content

Commit cd73b89

Browse files
authored
Update npm in publish-npm.yml only when node is setup (#309)
* Update npm in publish-npm.yml only when node is setup * fix comment * add environment to workflow * remove --scope flag as it does nothing here
1 parent d119e3f commit cd73b89

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/publish-npm.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ jobs:
1010
npm-publish:
1111
name: Publish to NPM & GitHub Package Registry
1212
runs-on: ubuntu-latest
13+
# Required for this workflow to have permission to publish NPM packages
14+
environment: release
1315
permissions:
1416
contents: read
1517
packages: write
16-
# id-token: write required for get-vault-secrets and trusted publishing
18+
# id-token: write required for npm trusted publishing
1719
id-token: write
1820
outputs:
1921
new_version: ${{ steps.version_check.outputs.version }}
@@ -47,6 +49,7 @@ jobs:
4749
registry-url: 'https://registry.npmjs.org'
4850

4951
- name: Install npm version ^11.5.1 # npm trusted publishing requires version ^11.5.1
52+
if: steps.version_check.outputs.changed == 'true'
5053
run: npm install -g npm@^11.5.1
5154

5255
- name: Install dependencies
@@ -59,7 +62,7 @@ jobs:
5962

6063
- name: Publish package to NPM
6164
if: steps.version_check.outputs.changed == 'true'
62-
run: npm publish --access public --scope grafana
65+
run: npm publish --access public
6366

6467
- name: Setup .npmrc file for GitHub Packages
6568
if: steps.version_check.outputs.changed == 'true'

0 commit comments

Comments
 (0)