Skip to content

Commit 1c1a0df

Browse files
authored
Merge pull request #168 from linearis-oss/fix/release-npm-publish-environment
fix(ci): use npm-publish environment in release job
2 parents 73be9a0 + 0339929 commit 1c1a0df

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/release-check.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ concurrency:
1919
jobs:
2020
release:
2121
runs-on: ubuntu-latest
22+
environment: npm-publish
2223
steps:
2324
- name: Guard workflow_dispatch caller permissions
2425
if: ${{ github.event_name == 'workflow_dispatch' }}
@@ -122,6 +123,16 @@ jobs:
122123
- name: Type check
123124
run: npx tsc --noEmit
124125

126+
- name: Verify npm auth
127+
env:
128+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
129+
run: |
130+
test -n "${NODE_AUTH_TOKEN}" || {
131+
echo "NPM_TOKEN missing (check job environment + secret scope)"
132+
exit 1
133+
}
134+
npm whoami --registry=https://registry.npmjs.org/
135+
125136
- name: Run semantic-release
126137
env:
127138
GH_TOKEN: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)