Skip to content

Commit c5472af

Browse files
authored
ci: Add zizmor to pre-commit and fix findings (#1457)
* chore: Add zizmor to pre-commit and fix findings * chore: Remove a few redudant quotes from YAML files This should be enforced by yamllint in the future. * ci: Add contents: read permission to reusable worflow callers * ci: Add id-token: write permission to reusable worflow callers
1 parent fdac4be commit c5472af

34 files changed

Lines changed: 220 additions & 33 deletions

.github/workflows/boil_pr.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
- "rust/boil/**.rs"
1010
- "Cargo.*"
1111

12+
permissions:
13+
contents: read
14+
1215
env:
1316
RUST_VERSION: 1.89.0
1417

@@ -29,7 +32,6 @@ jobs:
2932
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3033
with:
3134
persist-credentials: false
32-
submodules: recursive
3335

3436
- name: Run cargo-deny
3537
uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # v2.0.15

.github/workflows/boil_release.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ on:
66
tags:
77
- "boil-[0-9]+.[0-9]+.[0-9]+**"
88

9+
permissions: {}
10+
911
env:
1012
RUST_VERSION: 1.89.0
1113

1214
jobs:
1315
create-release:
1416
name: Create Draft Release
1517
runs-on: ubuntu-latest
18+
permissions:
19+
# Write is needed to draft the release
20+
# See https://github.com/softprops/action-gh-release/blob/153bb8e04406b158c6c84fc1615b65b24149a1fe/README.md?plain=1#L281
21+
contents: write
1622
steps:
1723
- name: Checkout
1824
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -44,6 +50,10 @@ jobs:
4450
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
4551
- { target: aarch64-apple-darwin, os: macos-latest }
4652
runs-on: ${{ matrix.targets.os }}
53+
permissions:
54+
# Write is needed to upload artifacts to the release
55+
# See https://github.com/softprops/action-gh-release/blob/153bb8e04406b158c6c84fc1615b65b24149a1fe/README.md?plain=1#L281
56+
contents: write
4757
steps:
4858
- name: Checkout
4959
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -74,6 +84,10 @@ jobs:
7484
finish-release:
7585
needs: [build]
7686
runs-on: ubuntu-latest
87+
permissions:
88+
# Write is needed to finalize the release
89+
# See https://github.com/softprops/action-gh-release/blob/153bb8e04406b158c6c84fc1615b65b24149a1fe/README.md?plain=1#L281
90+
contents: write
7791
steps:
7892
- name: Finish Release
7993
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0

.github/workflows/build_airflow.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ run-name: |
66
on:
77
workflow_dispatch:
88
schedule:
9-
- cron: '0 0 1/2 * *' # https://crontab.guru/#0_0_1/2_*_*
9+
- cron: 0 0 1/2 * * # https://crontab.guru/#0_0_1/2_*_*
1010
push:
1111
branches: [main]
1212
tags:
@@ -22,13 +22,18 @@ on:
2222
- .github/workflows/build_airflow.yaml
2323
- .github/workflows/reusable_build_image.yaml
2424

25+
permissions: {}
26+
2527
jobs:
2628
build_image:
2729
name: Reusable Workflow
2830
uses: ./.github/workflows/reusable_build_image.yaml
2931
secrets:
3032
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
3133
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
34+
permissions:
35+
id-token: write
36+
contents: read
3237
with:
3338
product-name: airflow
3439
sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}

.github/workflows/build_druid.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ run-name: |
66
on:
77
workflow_dispatch:
88
schedule:
9-
- cron: '0 1 1/2 * *' # https://crontab.guru/#0_1_1/2_*_*
9+
- cron: 0 1 1/2 * * # https://crontab.guru/#0_1_1/2_*_*
1010
push:
1111
branches: [main]
1212
tags:
@@ -24,13 +24,18 @@ on:
2424
- .github/workflows/build_druid.yaml
2525
- .github/workflows/reusable_build_image.yaml
2626

27+
permissions: {}
28+
2729
jobs:
2830
build_image:
2931
name: Reusable Workflow
3032
uses: ./.github/workflows/reusable_build_image.yaml
3133
secrets:
3234
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
3335
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
36+
permissions:
37+
id-token: write
38+
contents: read
3439
with:
3540
product-name: druid
3641
sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}

.github/workflows/build_hadoop.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ run-name: |
66
on:
77
workflow_dispatch:
88
schedule:
9-
- cron: '0 2 1/2 * *' # https://crontab.guru/#0_2_1/2_*_*
9+
- cron: 0 2 1/2 * * # https://crontab.guru/#0_2_1/2_*_*
1010
push:
1111
branches: [main]
1212
tags:
@@ -24,13 +24,18 @@ on:
2424
- .github/workflows/build_hadoop.yaml
2525
- .github/workflows/reusable_build_image.yaml
2626

27+
permissions: {}
28+
2729
jobs:
2830
build_image:
2931
name: Reusable Workflow
3032
uses: ./.github/workflows/reusable_build_image.yaml
3133
secrets:
3234
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
3335
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
36+
permissions:
37+
id-token: write
38+
contents: read
3439
with:
3540
product-name: hadoop
3641
sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}

.github/workflows/build_hbase.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ run-name: |
66
on:
77
workflow_dispatch:
88
schedule:
9-
- cron: '0 0 2/2 * *' # https://crontab.guru/#0_0_2/2_*_*
9+
- cron: 0 0 2/2 * * # https://crontab.guru/#0_0_2/2_*_*
1010
push:
1111
branches: [main]
1212
tags:
@@ -25,13 +25,18 @@ on:
2525
- .github/workflows/build_hbase.yaml
2626
- .github/workflows/reusable_build_image.yaml
2727

28+
permissions: {}
29+
2830
jobs:
2931
build_image:
3032
name: Reusable Workflow
3133
uses: ./.github/workflows/reusable_build_image.yaml
3234
secrets:
3335
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
3436
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
37+
permissions:
38+
id-token: write
39+
contents: read
3540
with:
3641
product-name: hbase
3742
sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}

.github/workflows/build_hive.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ run-name: |
66
on:
77
workflow_dispatch:
88
schedule:
9-
- cron: "0 2 2/2 * *" # https://crontab.guru/#0_2_2/2_*_*
9+
- cron: 0 2 2/2 * * # https://crontab.guru/#0_2_2/2_*_*
1010
push:
1111
branches: [main]
1212
tags:
@@ -25,13 +25,18 @@ on:
2525
- .github/workflows/build_hive.yaml
2626
- .github/workflows/reusable_build_image.yaml
2727

28+
permissions: {}
29+
2830
jobs:
2931
build_image:
3032
name: Reusable Workflow
3133
uses: ./.github/workflows/reusable_build_image.yaml
3234
secrets:
3335
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
3436
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
37+
permissions:
38+
id-token: write
39+
contents: read
3540
with:
3641
product-name: hive
3742
sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}

.github/workflows/build_java-base.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ run-name: |
66
on:
77
workflow_dispatch:
88
schedule:
9-
- cron: '0 0 1/2 * *' # https://crontab.guru/#0_0_1/2_*_*
9+
- cron: 0 0 1/2 * * # https://crontab.guru/#0_0_1/2_*_*
1010
push:
1111
branches: [main]
1212
tags:
@@ -20,13 +20,18 @@ on:
2020
- .github/workflows/build_java-base.yaml
2121
- .github/workflows/reusable_build_image.yaml
2222

23+
permissions: {}
24+
2325
jobs:
2426
build_image:
2527
name: Reusable Workflow
2628
uses: ./.github/workflows/reusable_build_image.yaml
2729
secrets:
2830
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
2931
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
32+
permissions:
33+
id-token: write
34+
contents: read
3035
with:
3136
product-name: java-base
3237
sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}

.github/workflows/build_java-devel.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ run-name: |
66
on:
77
workflow_dispatch:
88
schedule:
9-
- cron: '0 1 1/2 * *' # https://crontab.guru/#0_1_1/2_*_*
9+
- cron: 0 1 1/2 * * # https://crontab.guru/#0_1_1/2_*_*
1010
push:
1111
branches: [main]
1212
tags:
@@ -20,13 +20,18 @@ on:
2020
- .github/workflows/build_java-devel.yaml
2121
- .github/workflows/reusable_build_image.yaml
2222

23+
permissions: {}
24+
2325
jobs:
2426
build_image:
2527
name: Reusable Workflow
2628
uses: ./.github/workflows/reusable_build_image.yaml
2729
secrets:
2830
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
2931
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
32+
permissions:
33+
id-token: write
34+
contents: read
3035
with:
3136
product-name: java-devel
3237
sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}

.github/workflows/build_kafka-testing-tools.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ run-name: |
66
on:
77
workflow_dispatch:
88
schedule:
9-
- cron: '0 2 1/2 * *' # https://crontab.guru/#0_2_1/2_*_*
9+
- cron: 0 2 1/2 * * # https://crontab.guru/#0_2_1/2_*_*
1010
push:
1111
branches: [main]
1212
tags:
@@ -24,13 +24,18 @@ on:
2424
- .github/workflows/build_kafka-testing-tools.yaml
2525
- .github/workflows/reusable_build_image.yaml
2626

27+
permissions: {}
28+
2729
jobs:
2830
build_image:
2931
name: Reusable Workflow
3032
uses: ./.github/workflows/reusable_build_image.yaml
3133
secrets:
3234
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
3335
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
36+
permissions:
37+
id-token: write
38+
contents: read
3439
with:
3540
product-name: kafka-testing-tools
3641
sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}

0 commit comments

Comments
 (0)