Skip to content

Commit be6af0d

Browse files
frantic1048rainx
authored andcommitted
ci: migrate to trusted publishing
1 parent bf012f4 commit be6af0d

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
@@ -76,6 +76,9 @@ jobs:
7676
if: ${{ always() && !failure() && !cancelled() }}
7777
needs: check-beachball-changefile
7878
runs-on: ubuntu-latest
79+
permissions:
80+
id-token: write
81+
contents: read
7982
steps:
8083
- uses: actions/checkout@v4
8184
- uses: pnpm/action-setup@v4
@@ -91,19 +94,15 @@ jobs:
9194
- name: Publish (development)
9295
if: github.repository == 'RightCapitalHQ/php-parser' && github.base_ref == github.event.repository.default_branch
9396
env:
94-
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
97+
HEAD_REF: ${{ github.head_ref }}
9598
run: |
96-
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
9799
preid="${HEAD_REF//\//-}".${{ github.run_number }}.${{ github.run_attempt }}
98100
npm --no-git-tag-version version prerelease --preid="${preid}"
99101
pnpm publish --no-git-checks --access public --tag development
100102
101103
- name: Publish (main)
102104
if: github.repository == 'RightCapitalHQ/php-parser' && github.ref_name == github.event.repository.default_branch
103-
env:
104-
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
105105
run: |
106-
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
107106
git config --local user.email "npm-publisher@rightcapital.com"
108107
git config --local user.name "GitHub Actions[bot]"
109108
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/php-parser",
5+
"email": "im@pyonpyon.today",
6+
"dependentChangeType": "none"
7+
}

0 commit comments

Comments
 (0)