Skip to content

Commit 77cbe54

Browse files
authored
ci: setup trusted publishing (#19)
1 parent 2e2aad7 commit 77cbe54

File tree

6 files changed

+157
-111
lines changed

6 files changed

+157
-111
lines changed

.changeset/tender-parrots-film.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hideoo/generator-starlight-plugin': patch
3+
---
4+
5+
Setups trusted publishing using OpenID Connect (OIDC) authentication — no code changes.

.github/workflows/autofix.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: autofix.ci
22

3+
permissions: {}
4+
35
on:
46
push:
57
branches:
@@ -9,9 +11,6 @@ on:
911
- main
1012
workflow_call:
1113

12-
permissions:
13-
contents: read
14-
1514
concurrency:
1615
cancel-in-progress: true
1716
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
@@ -20,15 +19,19 @@ jobs:
2019
autofix:
2120
name: Format code
2221
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
2324
steps:
2425
- name: Checkout
25-
uses: actions/checkout@v4
26+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
27+
with:
28+
persist-credentials: false
2629

2730
- name: Install pnpm
28-
uses: pnpm/action-setup@v4
31+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
2932

3033
- name: Install Node.js
31-
uses: actions/setup-node@v4
34+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
3235
with:
3336
cache: pnpm
3437
node-version: 18
@@ -40,6 +43,6 @@ jobs:
4043
run: pnpm format
4144

4245
- name: Run autofix
43-
uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c
46+
uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 # v1.3.2
4447
with:
4548
fail-fast: false

.github/workflows/integration.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: integration
22

3+
permissions: {}
4+
35
on:
46
push:
57
branches:
@@ -19,13 +21,15 @@ jobs:
1921
runs-on: ubuntu-latest
2022
steps:
2123
- name: Checkout
22-
uses: actions/checkout@v4
24+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25+
with:
26+
persist-credentials: false
2327

2428
- name: Install pnpm
25-
uses: pnpm/action-setup@v4
29+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
2630

2731
- name: Install Node.js
28-
uses: actions/setup-node@v4
32+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
2933
with:
3034
cache: pnpm
3135
node-version: 18

.github/workflows/release.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: release
22

3+
permissions: {}
4+
35
on:
46
push:
57
branches:
@@ -16,29 +18,30 @@ jobs:
1618
pull-requests: write
1719
steps:
1820
- name: Checkout
19-
uses: actions/checkout@v4
21+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2022
with:
2123
fetch-depth: 0
24+
persist-credentials: false
2225

2326
- name: Install pnpm
24-
uses: pnpm/action-setup@v4
27+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
2528

2629
- name: Install Node.js
27-
uses: actions/setup-node@v4
30+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
2831
with:
29-
cache: pnpm
30-
node-version: 18
32+
node-version: 24
33+
package-manager-cache: false
3134

3235
- name: Install dependencies
3336
run: pnpm install
3437

3538
- name: Create Release Pull Request or Publish
36-
uses: changesets/action@v1
39+
uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3
3740
with:
3841
version: pnpm run version
3942
publish: pnpm changeset publish
4043
commit: 'ci: release'
4144
title: 'ci: release'
4245
env:
4346
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
NPM_TOKEN: '' # https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"yeoman-generator": "^7.4.0"
2020
},
2121
"devDependencies": {
22-
"@changesets/changelog-github": "^0.5.0",
23-
"@changesets/cli": "^2.27.10",
22+
"@changesets/changelog-github": "^0.5.1",
23+
"@changesets/cli": "^2.29.7",
2424
"@hideoo/eslint-config": "^4.0.0",
2525
"@hideoo/prettier-config": "^2.0.0",
2626
"@hideoo/tsconfig": "^2.0.1",
@@ -33,8 +33,7 @@
3333
},
3434
"packageManager": "pnpm@9.9.0",
3535
"publishConfig": {
36-
"access": "public",
37-
"provenance": true
36+
"access": "public"
3837
},
3938
"sideEffects": false,
4039
"keywords": [

0 commit comments

Comments
 (0)