Skip to content

Commit b08ef9a

Browse files
committed
THRIFT-5965: Added zizmor to run static analysis on GitHub actions
1 parent d7e4bf2 commit b08ef9a

9 files changed

Lines changed: 73 additions & 4 deletions

File tree

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@ updates:
2323
directory: "/"
2424
schedule:
2525
interval: monthly
26+
cooldown:
27+
default-days: 7
2628
- package-ecosystem: "gradle"
2729
directory: "/lib/java"
2830
schedule:
2931
interval: monthly
32+
cooldown:
33+
default-days: 7
3034
- package-ecosystem: "gradle"
3135
directory: "/lib/kotlin"
3236
schedule:
3337
interval: monthly
38+
cooldown:
39+
default-days: 7

.github/workflows/asf-allowlist-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2222
with:
2323
persist-credentials: false
24-
- uses: apache/infrastructure-actions/allowlist-check@main
24+
- uses: apache/infrastructure-actions/allowlist-check@8056239fafd626c8a4e2d6679506ba0d8e60f196 # main

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ jobs:
4848
runs-on: ${{ matrix.os }}
4949
steps:
5050
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
51+
with:
52+
persist-credentials: false
5153

5254
- name: Install dependencies
5355
run: |
@@ -120,6 +122,8 @@ jobs:
120122
runs-on: ${{ matrix.os }}
121123
steps:
122124
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
125+
with:
126+
persist-credentials: false
123127

124128
- name: Install dependencies
125129
run: |
@@ -157,6 +161,8 @@ jobs:
157161
fail-fast: false
158162
steps:
159163
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
164+
with:
165+
persist-credentials: false
160166

161167
- name: Set up PHP
162168
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # master
@@ -234,6 +240,8 @@ jobs:
234240
fail-fast: false
235241
steps:
236242
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
243+
with:
244+
persist-credentials: false
237245

238246
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
239247
with:
@@ -290,6 +298,8 @@ jobs:
290298
GRADLE_VERSION: "8.4"
291299
steps:
292300
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
301+
with:
302+
persist-credentials: false
293303

294304
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
295305
with:
@@ -402,6 +412,8 @@ jobs:
402412
shell: bash # required by net install script
403413
steps:
404414
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
415+
with:
416+
persist-credentials: false
405417

406418
- name: Install dependencies
407419
run: |
@@ -486,6 +498,8 @@ jobs:
486498
if: false # swift is currently broken and no maintainers around -> see THRIFT-5864
487499
steps:
488500
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
501+
with:
502+
persist-credentials: false
489503

490504
- name: Run bootstrap
491505
run: ./bootstrap.sh
@@ -524,6 +538,8 @@ jobs:
524538
TOOLCHAIN_VERSION: 1.85.1
525539
steps:
526540
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
541+
with:
542+
persist-credentials: false
527543

528544
- name: Install dependencies
529545
run: |
@@ -591,6 +607,8 @@ jobs:
591607
fail-fast: false
592608
steps:
593609
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
610+
with:
611+
persist-credentials: false
594612

595613
- name: Install dependencies
596614
run: |
@@ -666,6 +684,8 @@ jobs:
666684
runs-on: ${{ matrix.os }}
667685
steps:
668686
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
687+
with:
688+
persist-credentials: false
669689

670690
- name: Install dependencies
671691
run: |
@@ -720,6 +740,8 @@ jobs:
720740
runs-on: ubuntu-24.04
721741
steps:
722742
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
743+
with:
744+
persist-credentials: false
723745

724746
- name: Run bootstrap
725747
run: ./bootstrap.sh
@@ -767,6 +789,8 @@ jobs:
767789
runs-on: ubuntu-24.04
768790
steps:
769791
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
792+
with:
793+
persist-credentials: false
770794

771795
- name: Install dependencies
772796
run: |
@@ -843,6 +867,8 @@ jobs:
843867
SKIP_BUILD_EXT: ${{ matrix.skip-build-ext && '1' || '' }}
844868
steps:
845869
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
870+
with:
871+
persist-credentials: false
846872

847873
- name: Set up Ruby
848874
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
@@ -914,6 +940,8 @@ jobs:
914940
fail-fast: false
915941
steps:
916942
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
943+
with:
944+
persist-credentials: false
917945

918946
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
919947
with:

.github/workflows/cmake.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
runs-on: ubuntu-22.04
2222
steps:
2323
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
24+
with:
25+
persist-credentials: false
2426

2527
- name: Install dependencies
2628
timeout-minutes: 10

.github/workflows/msvc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
28+
with:
29+
persist-credentials: false
2830

2931
- name: Ensure expected workspace path
3032
shell: pwsh

.github/workflows/pypi.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
id-token: write
3535
steps:
3636
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37+
with:
38+
persist-credentials: false
3739

3840
- name: Set up Python
3941
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0

.github/workflows/release_ruby.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: Set up Ruby
4343
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
4444
with:
45-
bundler-cache: true
45+
bundler-cache: false
4646
ruby-version: "4.0"
4747
working-directory: lib/rb
4848

.github/workflows/release_rust.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,27 @@ jobs:
3434
publish:
3535
runs-on: ubuntu-latest
3636
if: false # currently broken and no maintainers around -> see THRIFT-5917
37+
permissions:
38+
contents: read
39+
id-token: write
3740
steps:
3841
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
42+
with:
43+
persist-credentials: false
3944
- name: Dryrun
4045
working-directory: lib/rs
4146
run: cargo publish --dry-run
4247

48+
- name: Authenticate to crates.io
49+
# Only publish if it's a tag and the tag is not a pre-release
50+
if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-') }}
51+
id: crates-io-auth
52+
uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe # v1.0.4
53+
4354
- name: Publish
4455
working-directory: lib/rs
4556
# Only publish if it's a tag and the tag is not a pre-release
4657
if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-') }}
4758
run: cargo publish
4859
env:
49-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
60+
CARGO_REGISTRY_TOKEN: ${{ steps.crates-io-auth.outputs.token }}

.github/workflows/sca.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "Static Code Analysis"
22

33
on:
44
push:
5-
branches: ["*"]
5+
branches: ["master"]
66
pull_request:
77
branches: ["*"]
88
workflow_dispatch:
@@ -41,6 +41,8 @@ jobs:
4141
runs-on: ubuntu-24.04
4242
steps:
4343
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
44+
with:
45+
persist-credentials: false
4446

4547
- name: Install dependencies
4648
run: |
@@ -243,3 +245,19 @@ jobs:
243245
fi
244246
245247
exit $failed
248+
249+
zizmor:
250+
name: Run zizmor
251+
runs-on: ubuntu-24.04
252+
permissions:
253+
security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
254+
contents: read # Only needed for private repos. Needed to clone the repo.
255+
actions: read # Only needed for private repos. Needed for upload-sarif to read workflow run info.
256+
steps:
257+
- name: Checkout repository
258+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
259+
with:
260+
persist-credentials: false
261+
262+
- name: Run zizmor
263+
uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3

0 commit comments

Comments
 (0)