6868 npm-publish-build :
6969 needs : build
7070 runs-on : ubuntu-latest
71+ if : github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
7172 steps :
7273 - uses : actions/download-artifact@v7
7374 with :
@@ -76,20 +77,19 @@ jobs:
7677 with :
7778 node-version : 20.x
7879 registry-url : ' https://registry.npmjs.org'
80+ - run : npm i -g npm@latest
7981 - uses : rlespinasse/github-slug-action@v4.x
8082 - name : Append commit hash to package version
8183 run : ' sed -i -E "s/(\"version\": *\"[^\"]+)/\1-${GITHUB_SHA_SHORT}/" package.json'
8284 - name : Disable pre- and post-publish actions
8385 run : ' sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json'
84- - uses : JS-DevTools/npm-publish@v4.1.2
85- if : github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
86- with :
87- tag : ${{ env.GITHUB_REF_SLUG }}
86+ - name : Publish to npm
87+ run : npm publish --tag ${{ env.GITHUB_REF_SLUG }}
8888
8989 npm-publish-latest :
9090 needs : [build, npm-publish-build]
9191 runs-on : ubuntu-latest
92- if : github.ref == 'refs/heads/main'
92+ if : github.ref == 'refs/heads/main' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
9393 steps :
9494 - uses : actions/download-artifact@v7
9595 with :
9898 with :
9999 node-version : 20.x
100100 registry-url : ' https://registry.npmjs.org'
101+ - run : npm i -g npm@latest
101102 - name : Disable pre- and post-publish actions
102103 run : ' sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json'
103- - uses : JS-DevTools/npm-publish@v4.1.2
104- if : github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
105- with :
106- tag : latest
104+ - name : Publish to npm
105+ run : npm publish --tag latest
0 commit comments