Skip to content

Commit 157dcac

Browse files
MAINT: Add Zizmor (#87)
1 parent f1eb539 commit 157dcac

5 files changed

Lines changed: 67 additions & 25 deletions

File tree

‎.github/dependabot.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ updates:
77
directory: '/'
88
schedule:
99
interval: 'monthly'
10+
cooldown:
11+
default-days: 7
1012

1113
# Maintain dependencies for npm
1214
- package-ecosystem: 'npm'
1315
directory: '/'
1416
schedule:
1517
interval: 'monthly'
18+
cooldown:
19+
default-days: 7
1620

1721
groups:
1822
dependencies:

‎.github/workflows/deploy.yml‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ on:
77
branches: [main]
88
workflow_dispatch:
99

10-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11-
permissions:
12-
contents: read
13-
pages: write
14-
id-token: write
10+
permissions: {}
1511

1612
# Allow only one concurrent deployment
1713
concurrency:
@@ -21,19 +17,22 @@ concurrency:
2117
jobs:
2218
build:
2319
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read # Required to check out the repository.
2422
steps:
2523
- name: Checkout
26-
uses: actions/checkout@v7
24+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2725
with:
2826
lfs: true
27+
persist-credentials: false
2928

3029
- name: Setup Node.js
31-
uses: actions/setup-node@v7
30+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
3231
with:
3332
node-version: '20'
3433
cache: 'npm'
3534
- name: Restore cache
36-
uses: actions/cache@v6
35+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
3736
with:
3837
path: |
3938
.next/cache
@@ -49,7 +48,7 @@ jobs:
4948
run: npm run build
5049

5150
- name: Upload artifact
52-
uses: actions/upload-pages-artifact@v5
51+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
5352
with:
5453
path: ./out
5554

@@ -59,8 +58,11 @@ jobs:
5958
url: ${{ steps.deployment.outputs.page_url }}
6059
runs-on: ubuntu-latest
6160
needs: build
61+
permissions:
62+
pages: write # Required by actions/deploy-pages to deploy to GitHub Pages.
63+
id-token: write # Required by actions/deploy-pages to verify the deployment originates from an appropriate source (OIDC).
6264
if: github.ref == 'refs/heads/main'
6365
steps:
6466
- name: Deploy to GitHub Pages
6567
id: deployment
66-
uses: actions/deploy-pages@v5
68+
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1

‎.github/workflows/linkcheck.yml‎

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,25 @@ on:
88
env:
99
LINK_TRACKING_ISSUE_NUMBER: 85
1010

11-
permissions:
12-
issues: write
11+
permissions: {}
1312

1413
jobs:
1514
check-urls:
1615
if: ${{ !github.event.repository.fork }}
1716
env:
1817
LYCHEE_REPORT_FILE: ./lychee/out.md
1918
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read # Required to check out the repository.
21+
issues: write # Required to update the link tracking issue.
2022
steps:
21-
- uses: actions/checkout@v7
23+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
24+
with:
25+
persist-credentials: false
2226

2327
- name: Link Checker
2428
id: lychee
25-
uses: lycheeverse/lychee-action@v2.9.0
29+
uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
2630
with:
2731
# v2 fails the job on broken links by default; keep the old behaviour
2832
# so the tracking issue below gets updated instead.
@@ -33,17 +37,19 @@ jobs:
3337
id: readReport
3438
run: |
3539
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
36-
echo "FILE_CONTENT<<$EOF" >> $GITHUB_OUTPUT
37-
echo "$(cat ${{ env.LYCHEE_REPORT_FILE }})" >> $GITHUB_OUTPUT
38-
echo "$EOF" >> $GITHUB_OUTPUT
39-
- run: echo "${{ steps.readReport.outputs.FILE_CONTENT }}"
40+
echo "FILE_CONTENT<<$EOF" >> "$GITHUB_OUTPUT"
41+
echo "$(cat "${LYCHEE_REPORT_FILE}")" >> "$GITHUB_OUTPUT"
42+
echo "$EOF" >> "$GITHUB_OUTPUT"
43+
- env:
44+
FILE_CONTENT: ${{ steps.readReport.outputs.FILE_CONTENT }}
45+
run: echo "${FILE_CONTENT}"
4046
- name: Update link tracking issue (update invalid links)
4147
if: steps.lychee.outputs.exit_code != 0
4248
env:
4349
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4450
ISSUE_BODY: ${{ steps.readReport.outputs.FILE_CONTENT }}
4551
run: |
46-
gh api --method PATCH "repos/${{ github.repository }}/issues/${LINK_TRACKING_ISSUE_NUMBER}" \
52+
gh api --method PATCH "repos/${GITHUB_REPOSITORY}/issues/${LINK_TRACKING_ISSUE_NUMBER}" \
4753
-f state=open \
4854
-f body="${ISSUE_BODY}"
4955
@@ -52,12 +58,12 @@ jobs:
5258
env:
5359
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5460
run: |
55-
gh api --method PATCH "repos/${{ github.repository }}/issues/${LINK_TRACKING_ISSUE_NUMBER}" \
61+
gh api --method PATCH "repos/${GITHUB_REPOSITORY}/issues/${LINK_TRACKING_ISSUE_NUMBER}" \
5662
-f state=closed \
5763
-f body='No invalid links found! 🤖'
5864
5965
- name: Upload artifact
60-
uses: actions/upload-artifact@v7
66+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
6167
with:
6268
name: lychee-report
6369
path: ${{ env.LYCHEE_REPORT_FILE }}

‎.github/workflows/zizmor.yml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: GHA Security Analysis
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions: {}
9+
10+
jobs:
11+
zizmor:
12+
name: GHA Security Analysis using Zizmor
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read # Required to check out the repository.
16+
security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20+
with:
21+
persist-credentials: false
22+
23+
- name: Run zizmor
24+
uses: zizmorcore/zizmor-action@53290badfa369cb0bf7ad16342cb62c2fa47ac7b # v0.8.0

‎.pre-commit-config.yaml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ repos:
1313
- id: double-quote-string-fixer
1414
exclude: \.html$
1515

16-
- repo: https://github.com/pre-commit/mirrors-prettier
17-
rev: 'v4.0.0-alpha.8'
16+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
17+
rev: v1.31.1
18+
hooks:
19+
- id: zizmor
20+
args: ['--offline']
21+
22+
- repo: https://github.com/rbubley/mirrors-prettier # Update mirror as official mirror is deprecated
23+
rev: v3.9.10
1824
hooks:
1925
- id: prettier
2026
exclude: \.html$
@@ -29,8 +35,8 @@ repos:
2935
|vue\
3036
|yaml|yml\
3137
)$"
32-
- repo: https://github.com/pre-commit/mirrors-prettier
33-
rev: 'v4.0.0-alpha.8'
38+
- repo: https://github.com/rbubley/mirrors-prettier # Update mirror as official mirror is deprecated
39+
rev: v3.9.10
3440
hooks:
3541
- id: prettier
3642

0 commit comments

Comments
 (0)