Skip to content

Commit 12536ac

Browse files
authored
ci: add zizmor (#1146)
* ci: add zizmor * trigger ci * adjust permissions * typo * adjust * adjust * chore: auto version bump [bot] * adjust * adjust * fix * chore: auto version bump [bot] * undo bump version * fix branch --------- Co-authored-by: Thegaram <[email protected]>
1 parent 94fcd7d commit 12536ac

File tree

6 files changed

+59
-6
lines changed

6 files changed

+59
-6
lines changed

.github/workflows/bump_version.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ jobs:
1414
try-to-bump:
1515
if: contains(github.event.pull_request.labels.*.name, 'bump-version')
1616
runs-on: ubuntu-latest
17+
permissions:
18+
# Give the default GITHUB_TOKEN write permission to commit and push the
19+
# added or changed files to the repository.
20+
contents: write
21+
1722
steps:
1823
- name: Checkout code
19-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2025
with:
2126
ref: ${{ github.head_ref }}
22-
persist-credentials: false
27+
# note: this is needed by git-auto-commit-action below
28+
persist-credentials: true
2329

2430
- name: check diff
2531
id: check_diff
@@ -29,7 +35,7 @@ jobs:
2935
# fetch develop branch so that we can diff against later
3036
git fetch origin develop
3137
32-
echo 'checking verion changes in diff...'
38+
echo 'checking version changes in diff...'
3339
3440
# check if version changed in version.go
3541
# note: the grep will fail if use \d instead of [0-9]
@@ -59,7 +65,7 @@ jobs:
5965
run: node .github/scripts/bump_version_dot_go.mjs
6066

6167
# Commits made by this Action do not trigger new Workflow runs
62-
- uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a
68+
- uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 # v5.1.0
6369
if: steps.check_diff.outputs.result == 'bump'
6470
with:
6571
skip_fetch: true # already did fetch in check diff

.github/workflows/docker-arm64.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
jobs:
1212
build-and-push-arm64-image:
1313
runs-on: ubuntu-latest
14+
permissions: {}
15+
1416
strategy:
1517
matrix:
1618
arch:
@@ -32,6 +34,7 @@ jobs:
3234
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2.10.0
3335
with:
3436
cache-binary: false
37+
3538
- name: Login to Docker Hub
3639
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 #v3.3.0
3740
with:

.github/workflows/docker.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
jobs:
1111
build-and-push:
1212
runs-on: ubuntu-latest
13+
permissions: {}
14+
1315
steps:
1416
- name: Checkout code
1517
uses: actions/checkout@v2

.github/workflows/l2geth_ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: CI
2+
13
on:
24
push:
35
branches: # we keep this to avoid triggering `push` & `pull_request` every time we update a PR
@@ -11,12 +13,12 @@ on:
1113
- reopened
1214
- synchronize
1315
- ready_for_review
14-
name: CI
15-
jobs:
1616

17+
jobs:
1718
build-mock-ccc-geth: # build geth with mock circuit capacity checker
1819
if: github.event.pull_request.draft == false
1920
runs-on: ubuntu-latest
21+
permissions: {}
2022
steps:
2123
- name: Install Go
2224
uses: actions/setup-go@v2
@@ -35,6 +37,7 @@ jobs:
3537
build-geth: # build geth with circuit capacity checker
3638
if: github.event_name == 'push' # will only be triggered when pushing to main & staging & develop & alpha
3739
runs-on: ubuntu-latest
40+
permissions: {}
3841
steps:
3942
- name: Install Go
4043
uses: actions/setup-go@v2
@@ -62,6 +65,7 @@ jobs:
6265
check:
6366
if: github.event.pull_request.draft == false
6467
runs-on: ubuntu-latest
68+
permissions: {}
6569
steps:
6670
- name: Install Go
6771
uses: actions/setup-go@v2
@@ -81,6 +85,7 @@ jobs:
8185
goimports-lint:
8286
if: github.event.pull_request.draft == false
8387
runs-on: ubuntu-latest
88+
permissions: {}
8489
steps:
8590
- name: Install Go
8691
uses: actions/setup-go@v2
@@ -107,6 +112,7 @@ jobs:
107112
go-mod-tidy-lint:
108113
if: github.event.pull_request.draft == false
109114
runs-on: ubuntu-latest
115+
permissions: {}
110116
steps:
111117
- name: Install Go
112118
uses: actions/setup-go@v2
@@ -130,6 +136,7 @@ jobs:
130136
test:
131137
if: github.event.pull_request.draft == false
132138
runs-on: ubuntu-latest
139+
permissions: {}
133140
steps:
134141
- name: Install Go
135142
uses: actions/setup-go@v2

.github/workflows/semgrep.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
semgrep:
1616
name: semgrep/ci
1717
runs-on: ubuntu-20.04
18+
permissions: {}
1819
env:
1920
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
2021
container:

.github/workflows/zizmor.yml

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

0 commit comments

Comments
 (0)