Skip to content

Commit 30e3fb1

Browse files
authored
ci: Switch to trusted publishing (#51)
* ci: Switch to trusted publishing * update npm only when a release is created
1 parent de221d3 commit 30e3fb1

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.github/workflows/release-please.yml @eslint/eslint-tsc

.github/workflows/release-please.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ on:
22
push:
33
branches:
44
- main
5+
56
name: release-please
67
jobs:
78
release-please:
@@ -30,10 +31,16 @@ jobs:
3031
node-version: lts/*
3132
registry-url: https://registry.npmjs.org
3233
if: ${{ steps.release.outputs.release_created }}
33-
- run: npm publish --provenance
34-
env:
35-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
35+
# npm 11.5.1 or later is required so update to latest to be sure
36+
- name: Update npm
37+
run: npm install -g npm@latest
38+
if: ${{ steps.release.outputs.release_created }}
39+
40+
- name: Publish to npm
41+
run: npm publish --provenance
3642
if: ${{ steps.release.outputs.release_created }}
43+
3744
- run: 'npx @humanwhocodes/tweet "eslint-transforms ${{ steps.release.outputs.tag_name }} has been released: ${{ steps.release.outputs.html_url }}"'
3845
if: ${{ steps.release.outputs.release_created }}
3946
env:

0 commit comments

Comments
 (0)