Skip to content

Commit bf83b38

Browse files
authored
ci: adopt shared CI tooling (#193)
* ci: adopt shared CI tooling * ci: clarify lint workflow naming
1 parent 9317edf commit bf83b38

7 files changed

Lines changed: 64 additions & 21 deletions

File tree

.cspell.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"changelogithub",
1212
"elif",
1313
"nvmrc",
14+
"zizmor",
1415

1516
// auth words
1617
"scim",

.github/workflows/ci.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,19 @@ on:
1111
- v*.x
1212
merge_group: {}
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
test:
1619
runs-on: ubuntu-latest
1720
steps:
1821
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1922
with:
2023
fetch-depth: 0
24+
persist-credentials: false
2125

22-
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
23-
24-
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
25-
with:
26-
node-version-file: '.nvmrc'
27-
registry-url: 'https://registry.npmjs.org'
28-
cache: pnpm
29-
30-
- name: Install
31-
run: pnpm install
26+
- uses: better-auth/shared-workflows/.github/actions/setup-pnpm@08e5520e7a829b03bee1152913682b67d2ba44b1
3227

3328
- name: Build
3429
run: pnpm build
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Lint GitHub Actions
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/actions/**"
7+
- ".github/workflows/**"
8+
- ".github/zizmor.yml"
9+
push:
10+
branches: [main]
11+
paths:
12+
- ".github/actions/**"
13+
- ".github/workflows/**"
14+
- ".github/zizmor.yml"
15+
16+
permissions: {}
17+
18+
jobs:
19+
lint:
20+
permissions:
21+
contents: read
22+
uses: better-auth/shared-workflows/.github/workflows/lint-github-actions.yml@08e5520e7a829b03bee1152913682b67d2ba44b1
23+
24+
zizmor:
25+
if: github.event_name == 'pull_request'
26+
permissions:
27+
actions: read
28+
contents: read
29+
uses: better-auth/shared-workflows/.github/workflows/zizmor.yml@08e5520e7a829b03bee1152913682b67d2ba44b1
30+
31+
zizmor-code-scanning:
32+
if: github.event_name == 'push'
33+
permissions:
34+
actions: read
35+
contents: read
36+
security-events: write
37+
uses: better-auth/shared-workflows/.github/workflows/zizmor-code-scanning.yml@08e5520e7a829b03bee1152913682b67d2ba44b1

.github/workflows/preview.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Publish Any Commit
22
on: [pull_request]
33

4+
permissions:
5+
contents: read
6+
47
jobs:
58
build:
69
runs-on: ubuntu-latest
@@ -9,19 +12,11 @@ jobs:
912
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1013
with:
1114
fetch-depth: 0
15+
persist-credentials: false
1216

13-
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
14-
15-
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
16-
with:
17-
node-version-file: '.nvmrc'
18-
registry-url: 'https://registry.npmjs.org'
19-
cache: pnpm
20-
21-
- name: Install
22-
run: pnpm install
17+
- uses: better-auth/shared-workflows/.github/actions/setup-pnpm@08e5520e7a829b03bee1152913682b67d2ba44b1
2318

2419
- name: Build
2520
run: pnpm build
2621

27-
- run: pnpm dlx pkg-pr-new publish './packages/better-call'
22+
- run: pnpm exec pkg-pr-new publish './packages/better-call'

.github/zizmor.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
rules:
2+
use-trusted-publishing:
3+
ignore:
4+
# pkg.pr.new publishes preview packages to its own npm-compatible registry.
5+
- preview.yml

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"cspell": "^10.0.1",
2727
"knip": "^6.29.0",
2828
"lefthook": "^2.1.10",
29+
"pkg-pr-new": "0.0.88",
2930
"publint": "^0.3.22",
3031
"tinyglobby": "^0.2.17",
3132
"tsdown": "0.22.14",

pnpm-lock.yaml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)