Skip to content

Commit e7878f9

Browse files
Copilotjeswr
andcommitted
Use npm CLI directly instead of JS-DevTools action
Co-authored-by: jeswr <63333554+jeswr@users.noreply.github.com>
1 parent c737309 commit e7878f9

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
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:
@@ -98,9 +98,8 @@ jobs:
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

Comments
 (0)