Skip to content

Commit e9c3df4

Browse files
committed
Use trusted publishing
1 parent 77a5db8 commit e9c3df4

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/_publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
secrets:
1616
registry_token:
1717
description: The package registry token.
18-
required: true
18+
required: false
1919

2020
jobs:
2121
publish:
@@ -24,21 +24,21 @@ jobs:
2424
timeout-minutes: 30
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v5
2828
- name: Setup
2929
uses: ./.github/actions/setup
3030
with:
3131
install_dependencies: 'false'
3232
- name: Download artifact
33-
uses: actions/download-artifact@v4
33+
uses: actions/download-artifact@v6
3434
with:
3535
name: ${{ inputs.artifact_name }}
3636
path: .
3737
- name: Get meta
3838
id: meta
3939
run: echo "tgz=$(ls *.tgz | head -n1)" >> $GITHUB_OUTPUT
4040
- name: Publish
41-
uses: JS-DevTools/npm-publish@v3
41+
uses: JS-DevTools/npm-publish@v4
4242
with:
4343
access: public
4444
token: ${{ secrets.registry_token }}

.github/workflows/publish.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ jobs:
1919
needs: build
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v5
2323
with:
2424
fetch-depth: 0
2525
- name: Download artifact
26-
uses: actions/download-artifact@v4
26+
uses: actions/download-artifact@v6
2727
with:
2828
name: ${{ needs.build.outputs.artifact_name }}
2929
path: .
@@ -47,11 +47,12 @@ jobs:
4747
name: npm
4848
uses: ./.github/workflows/_publish.yml
4949
needs: build
50+
permissions:
51+
contents: read
52+
id-token: write
5053
with:
5154
artifact_name: ${{ needs.build.outputs.artifact_name }}
5255
registry_url: https://registry.npmjs.org
53-
secrets:
54-
registry_token: ${{ secrets.NPM_TOKEN }}
5556
github:
5657
name: GitHub Packages
5758
uses: ./.github/workflows/_publish.yml

0 commit comments

Comments
 (0)