Skip to content

Commit 915f584

Browse files
authored
ci: add zizmor workflow (#134)
* ci: add zizmor workflow * ci: clarify release checkout credentials * Update .github/workflows/benchmarks.yml
1 parent d6aed9c commit 915f584

5 files changed

Lines changed: 53 additions & 14 deletions

File tree

.github/workflows/autofix.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v6.0.1
21+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
with:
23+
persist-credentials: false
2224
- name: Setup Tools
2325
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
2426
- name: Fix formatting

.github/workflows/benchmarks.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ on:
1919

2020
permissions:
2121
contents: read
22-
id-token: write
2322

2423
env:
2524
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
@@ -29,16 +28,21 @@ jobs:
2928
benchmarks:
3029
name: Run intent CodSpeed benchmark
3130
runs-on: ubuntu-latest
31+
permissions:
32+
contents: read
33+
id-token: write
3234
steps:
3335
- name: Checkout
34-
uses: actions/checkout@v6.0.1
36+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37+
with:
38+
persist-credentials: false
3539

3640
- name: Setup Tools
3741
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
3842

3943
- name: Run intent CodSpeed benchmark
4044
continue-on-error: true
41-
uses: CodSpeedHQ/action@v4
45+
uses: CodSpeedHQ/action@3194d9a39c4d46684cb44bf7207fc56626aad8fd # v4.15.1
4246
with:
4347
mode: simulation
4448
run: WITH_INSTRUMENTATION=1 pnpm exec nx run @benchmarks/intent:test:perf

.github/workflows/pr.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v6.0.1
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2727
with:
2828
fetch-depth: 0
29+
persist-credentials: false
2930
- name: Setup Tools
3031
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
3132
- name: Get base and head commits for `nx affected`
32-
uses: nrwl/nx-set-shas@v4.4.0
33+
uses: nrwl/nx-set-shas@3e9ad7370203c1e93d109be57f3b72eb0eb511b1 # v4.4.0
3334
with:
3435
main-branch-name: main
3536
- name: Run Checks
@@ -39,9 +40,10 @@ jobs:
3940
runs-on: ubuntu-latest
4041
steps:
4142
- name: Checkout
42-
uses: actions/checkout@v6.0.1
43+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4344
with:
4445
fetch-depth: 0
46+
persist-credentials: false
4547
- name: Setup Tools
4648
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
4749
- name: Build Packages

.github/workflows/release.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,23 @@ env:
1313
SERVER_PRESET: 'node-server'
1414

1515
permissions:
16-
contents: write
17-
id-token: write
18-
pull-requests: write
16+
contents: read
1917

2018
jobs:
2119
release:
2220
name: Release
2321
if: "!contains(github.event.head_commit.message, 'ci: changeset release')"
2422
runs-on: ubuntu-latest
23+
permissions:
24+
contents: write
25+
id-token: write
26+
pull-requests: write
2527
steps:
2628
- name: Checkout
27-
uses: actions/checkout@v6.0.2
29+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2830
with:
2931
fetch-depth: 0
32+
persist-credentials: true # release job pushes version changes
3033
- name: Check for changesets
3134
id: changesets
3235
run: |
@@ -61,7 +64,7 @@ jobs:
6164
git config user.email "github-actions[bot]@users.noreply.github.com"
6265
git add .
6366
if git commit -m "ci: changeset release"; then
64-
git push
67+
git push origin "HEAD:${GITHUB_REF_NAME}"
6568
echo "committed=true" >> "$GITHUB_OUTPUT"
6669
fi
6770
env:
@@ -80,10 +83,14 @@ jobs:
8083
fi
8184
- name: Publish Packages
8285
if: steps.commit.outputs.committed == 'true'
83-
run: pnpm run changeset:publish ${{ steps.dist-tag.outputs.tag && format('--tag {0}', steps.dist-tag.outputs.tag) }}
86+
run: pnpm run changeset:publish ${DIST_TAG_ARG}
87+
env:
88+
DIST_TAG_ARG: ${{ steps.dist-tag.outputs.tag && format('--tag {0}', steps.dist-tag.outputs.tag) }}
8489
- name: Create GitHub Release
8590
if: steps.commit.outputs.committed == 'true'
86-
run: node scripts/create-github-release.mjs ${{ steps.dist-tag.outputs.prerelease == 'true' && '--prerelease' }} ${{ steps.dist-tag.outputs.latest == 'true' && '--latest' }}
91+
run: node scripts/create-github-release.mjs ${PRERELEASE_ARG} ${LATEST_ARG}
8792
env:
93+
PRERELEASE_ARG: ${{ steps.dist-tag.outputs.prerelease == 'true' && '--prerelease' }}
94+
LATEST_ARG: ${{ steps.dist-tag.outputs.latest == 'true' && '--latest' }}
8895
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8996
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/zizmor.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: GitHub Actions Security Analysis
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: ['**']
8+
9+
permissions: {}
10+
11+
jobs:
12+
zizmor:
13+
name: Run zizmor
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
with:
19+
persist-credentials: false
20+
- name: Run zizmor
21+
uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3
22+
with:
23+
advanced-security: false
24+
annotations: true

0 commit comments

Comments
 (0)