Skip to content

Commit 5594f4a

Browse files
authored
Merge pull request #74 from maxmind/nobeid/github-actions-zizmor
integrate zizmor in github actions
2 parents f73f12b + 32b7efe commit 5594f4a

File tree

4 files changed

+54
-5
lines changed

4 files changed

+54
-5
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@ jobs:
1919
id-token: write
2020
steps:
2121
- uses: actions/checkout@v4
22+
with:
23+
persist-credentials: false
24+
25+
# zizmor complains that 'v1' is a ref that can be provided by both the branch and tag namespaces.
26+
# specify that we want the v1 branch.
2227
- name: Set up Ruby
23-
uses: ruby/setup-ruby@v1
28+
uses: ruby/setup-ruby@refs/heads/v1
2429
with:
25-
bundler-cache: true
2630
ruby-version: ruby
2731

28-
- uses: rubygems/release-gem@v1
32+
# zizmor complains that 'v1' is a ref that can be provided by both the branch and tag namespaces.
33+
# specify that we want the v1 branch.
34+
- uses: rubygems/release-gem@refs/heads/v1

.github/workflows/rubocop.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
- uses: ruby/setup-ruby@v1
14+
with:
15+
persist-credentials: false
16+
17+
# zizmor complains that 'v1' is a ref that can be provided by both the branch and tag namespaces.
18+
# specify that we want the v1 branch.
19+
- uses: ruby/setup-ruby@refs/heads/v1
1520
with:
1621
ruby-version: 3.4
22+
1723
- run: bundle install
1824
- run: bundle exec rake -t rubocop

.github/workflows/test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@ jobs:
2929
- uses: actions/checkout@v4
3030
with:
3131
submodules: true
32-
- uses: ruby/setup-ruby@v1
32+
persist-credentials: false
33+
34+
# zizmor complains that 'v1' is a ref that can be provided by both the branch and tag namespaces.
35+
# specify that we want the v1 branch.
36+
- uses: ruby/setup-ruby@refs/heads/v1
3337
with:
3438
ruby-version: ${{ matrix.version }}
39+
3540
- run: bundle install
3641
- run: bundle exec rake -t test

.github/workflows/zizmor.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
with:
27+
enable-cache: false
28+
29+
- name: Run zizmor
30+
run: uvx zizmor --format plain .
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)