Skip to content

Commit 4685a52

Browse files
committed
integrate zizmor in github actions
1 parent 1ca40fb commit 4685a52

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

Diff for: .github/workflows/codeql-analysis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
# We must fetch at least the immediate parents so that if this is
2121
# a pull request then we can checkout the head.
2222
fetch-depth: 2
23+
persist-credentials: false
2324

2425
# If this run was triggered by a pull request event, then checkout
2526
# the head of the pull request instead of the merge commit.

Diff for: .github/workflows/go.yml

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727

2828
- name: Check out code into the Go module directory
2929
uses: actions/checkout@v4
30+
with:
31+
persist-credentials: false
3032

3133
- name: Get dependencies
3234
run: go get -v -t -d ./...

Diff for: .github/workflows/golangci-lint.yml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
with:
1616
go-version: 1.21
1717
- uses: actions/checkout@v4
18+
with:
19+
persist-credentials: false
1820
- name: golangci-lint
1921
uses: golangci/golangci-lint-action@v6
2022
with:

Diff for: .github/workflows/zizmor.yml

+36
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)