Skip to content

Commit 1af5a03

Browse files
frantic1048rainx
authored andcommitted
ci: migrate to trusted publishing
1 parent 5043f3e commit 1af5a03

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ jobs:
7979
if: ${{ always() && !failure() && !cancelled() }}
8080
needs: [test, check-beachball-changefile]
8181
runs-on: ubuntu-latest
82+
permissions:
83+
id-token: write
84+
contents: read
8285
steps:
8386
- uses: actions/checkout@v4
8487
- uses: pnpm/action-setup@v4
@@ -94,19 +97,15 @@ jobs:
9497
- name: Publish (development)
9598
if: github.repository == 'RightCapitalHQ/phpdoc-parser' && github.base_ref == github.event.repository.default_branch
9699
env:
97-
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
100+
HEAD_REF: ${{ github.head_ref }}
98101
run: |
99-
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
100102
preid="${HEAD_REF//\//-}".${{ github.run_number }}.${{ github.run_attempt }}
101103
npm --no-git-tag-version version prerelease --preid="${preid}"
102104
pnpm publish --no-git-checks --access public --tag development
103105
104106
- name: Publish (main)
105107
if: github.repository == 'RightCapitalHQ/phpdoc-parser' && github.ref_name == github.event.repository.default_branch
106-
env:
107-
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
108108
run: |
109-
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
110109
git config --local user.email "[email protected]"
111110
git config --local user.name "GitHub Actions[bot]"
112111
pnpm beachball publish --access public --yes -m 'chore(release): applying package updates'

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.17.1
1+
24.10.0
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"comment": "ci: migrate to trusted publishing",
3+
"type": "none",
4+
"packageName": "@rightcapital/phpdoc-parser",
5+
"email": "[email protected]",
6+
"dependentChangeType": "none"
7+
}

0 commit comments

Comments
 (0)