Skip to content

Commit 03ae7bb

Browse files
committed
Use explicit checkout ref in npm publish workflow
1 parent 094e816 commit 03ae7bb

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ on:
1010
required: true
1111
type: string
1212

13-
env:
14-
RELEASE_REF: ${{ inputs.tag || github.event.release.tag_name || github.ref_name }}
15-
1613
permissions: {}
1714

1815
jobs:
@@ -26,7 +23,7 @@ jobs:
2623
- uses: actions/checkout@v6
2724
with:
2825
persist-credentials: false
29-
ref: ${{ env.RELEASE_REF }}
26+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.event.release.target_commitish }}
3027
- uses: actions/setup-node@v6
3128
with:
3229
node-version: '24.x'
@@ -106,7 +103,7 @@ jobs:
106103
- uses: actions/checkout@v6
107104
with:
108105
persist-credentials: false
109-
ref: ${{ env.RELEASE_REF }}
106+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.event.release.target_commitish }}
110107
- uses: actions/setup-node@v6
111108
with:
112109
node-version: '24.x'

0 commit comments

Comments
 (0)