Skip to content

Commit 903bee6

Browse files
committed
integrate zizmor in github actions
1 parent 58729ef commit 903bee6

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 2
24+
persist-credentials: false
2425

2526
- name: Initialize CodeQL
2627
uses: github/codeql-action/init@v3

.github/workflows/hugo.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
with:
1616
submodules: true
1717
fetch-depth: 0
18+
persist-credentials: false
1819

1920
- name: Setup Hugo
2021
uses: peaceiris/actions-hugo@v3

.github/workflows/lint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v4
20+
with:
21+
persist-credentials: false
2022

2123
- id: build
2224
run: echo "::set-output name=hash::${{ hashFiles('assets/**', 'content/**', 'layouts/**', 'static/**', '**/package.json', '**/package-lock.json') }}"
@@ -32,6 +34,8 @@ jobs:
3234
steps:
3335
- name: Checkout
3436
uses: actions/checkout@v4
37+
with:
38+
persist-credentials: false
3539

3640
- uses: actions/setup-node@v4
3741
with:

.github/workflows/zizmor.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: GitHub Actions Security Analysis with zizmor
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["**"]
8+
9+
jobs:
10+
zizmor:
11+
name: zizmor latest via PyPI
12+
runs-on: ubuntu-latest
13+
permissions:
14+
security-events: write
15+
# required for workflows in private repositories
16+
contents: read
17+
actions: read
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
persist-credentials: false
23+
24+
- name: Install the latest version of uv
25+
uses: astral-sh/setup-uv@v5
26+
27+
- name: Run zizmor
28+
run: uvx zizmor --format sarif . > results.sarif
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Upload SARIF file
33+
uses: github/codeql-action/upload-sarif@v3
34+
with:
35+
sarif_file: results.sarif
36+
category: zizmor

0 commit comments

Comments
 (0)