Skip to content

Commit b46bfac

Browse files
committed
chore(actions): address zizmor findings
This PR is an auto-generated attempt to address zizmor findings. It may not catch everything, and should be reviewed by repository owners. If it is unhelpful, feel free to close the PR and address separately. This PR was generated by running `zizmor --fix=all --gh-token=$(gh auth token) ./.github/workflows`. See go/github-zizmor-help for instructions to install and run. If this PR is helpful, feel free to approve and merge, or edit/modify as needed to get it to the right state. Repository owners must ultimately ensure compliance by 2026-07-13. The purpose of this PR is to provide some assistance with achieving that as a first pass. This will become a blocking check for new changes to github workflows on 2026-07-13 within the `googleapis` org. There may be some ignored findings (with the comment `# zizmor: ignore[...]`), which you may fix if feasible.
1 parent affdc9c commit b46bfac

46 files changed

Lines changed: 802 additions & 346 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/changelog_generation.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
permissions:
2+
contents: read
3+
14
on:
25
pull_request:
36
types:
@@ -23,9 +26,10 @@ jobs:
2326
github.event.sender.login == 'release-please[bot]' && github.head_ref == 'release-please--branches--main' &&
2427
contains(github.event.pull_request.labels.*.name, 'autorelease: pending')
2528
steps:
26-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
2730
with:
2831
ref: ${{ github.head_ref }}
32+
persist-credentials: false
2933
- name: Show status of the branch checked out
3034
run: |
3135
git status

.github/workflows/changelog_generation_test.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
permissions:
2+
contents: read
3+
14
name: CHANGELOG.md generation test
25

36
on:
@@ -11,7 +14,9 @@ jobs:
1114
runs-on: ubuntu-latest
1215
steps:
1316
- name: Checkout code
14-
uses: actions/checkout@v3
17+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
18+
with:
19+
persist-credentials: false
1520
- name: Unit Test
1621
run: |
1722
python3 .github/release-note-generation/unit_test.py

.github/workflows/ci.yaml

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# limitations under the License.
1414
# Github action job to test core java library features on
1515
# downstream client libraries before they are released.
16+
permissions:
17+
contents: read
18+
1619
on:
1720
push:
1821
branches:
@@ -32,7 +35,9 @@ jobs:
3235
# runnable is true if there are changes outside the .github/workflows directory OR if ci.yaml itself (or kokoro scripts) is modified.
3336
runnable: ${{ fromJSON(steps.filter.outputs.all_count) > fromJSON(steps.filter.outputs.workflows_count) || fromJSON(steps.filter.outputs.ci_count) > 0 }}
3437
steps:
35-
- uses: actions/checkout@v6
38+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
39+
with:
40+
persist-credentials: false
3641
# Use this action, rather than a file filter so that we can make this
3742
# mandatory.
3843
# See https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#example-including-branches
@@ -65,16 +70,18 @@ jobs:
6570
id: date
6671
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
6772
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
68-
- uses: actions/checkout@v4
73+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
6974
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
70-
- uses: actions/setup-java@v4
75+
with:
76+
persist-credentials: false
77+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
7178
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
7279
with:
7380
distribution: temurin
7481
java-version: ${{matrix.java}}
7582
- run: java -version
7683
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
77-
- uses: actions/cache@v4
84+
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
7885
id: mvn-cache
7986
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
8087
with:
@@ -94,9 +101,11 @@ jobs:
94101
id: date
95102
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
96103
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
97-
- uses: actions/checkout@v4
104+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
98105
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
99-
- uses: actions/setup-java@v4
106+
with:
107+
persist-credentials: false
108+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
100109
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
101110
with:
102111
java-version: 8
@@ -107,13 +116,13 @@ jobs:
107116
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
108117
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
109118
shell: bash
110-
- uses: actions/setup-java@v4
119+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
111120
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
112121
with:
113122
java-version: 11
114123
distribution: temurin
115124
cache: maven
116-
- uses: actions/cache@v4
125+
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
117126
id: mvn-cache
118127
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
119128
with:
@@ -135,7 +144,9 @@ jobs:
135144
outputs:
136145
packages: ${{ steps.filter.outputs.changes }}
137146
steps:
138-
- uses: actions/checkout@v6
147+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
148+
with:
149+
persist-credentials: false
139150
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
140151
id: filter
141152
with:
@@ -233,8 +244,10 @@ jobs:
233244
- name: Get current week within the year
234245
id: date
235246
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
236-
- uses: actions/checkout@v4
237-
- uses: actions/setup-java@v4
247+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
248+
with:
249+
persist-credentials: false
250+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
238251
with:
239252
distribution: temurin
240253
java-version: ${{matrix.java}}
@@ -256,14 +269,16 @@ jobs:
256269
- name: Get current week within the year
257270
id: date
258271
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
259-
- uses: actions/checkout@v4
260-
- uses: actions/setup-java@v4
272+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
273+
with:
274+
persist-credentials: false
275+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
261276
with:
262277
java-version: 11
263278
distribution: temurin
264279
cache: maven
265280
- run: java -version
266-
- uses: actions/cache@v4
281+
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
267282
id: mvn-cache
268283
with:
269284
path: ~/.m2/repository
@@ -274,7 +289,7 @@ jobs:
274289
env:
275290
BUILD_SUBDIR: ${{matrix.package}}
276291
JOB_TYPE: install
277-
- uses: actions/setup-java@v4
292+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
278293
with:
279294
java-version: ${{matrix.java}}
280295
distribution: temurin
@@ -301,8 +316,10 @@ jobs:
301316
matrix:
302317
package: ${{ fromJSON(needs.changes.outputs.packages) }}
303318
steps:
304-
- uses: actions/checkout@v4
305-
- uses: actions/setup-java@v4
319+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
320+
with:
321+
persist-credentials: false
322+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
306323
with:
307324
distribution: temurin
308325
java-version: 11
@@ -318,8 +335,10 @@ jobs:
318335
matrix:
319336
package: ${{ fromJSON(needs.changes.outputs.packages) }}
320337
steps:
321-
- uses: actions/checkout@v4
322-
- uses: actions/setup-java@v4
338+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
339+
with:
340+
persist-credentials: false
341+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
323342
with:
324343
distribution: temurin
325344
java-version: 17
@@ -344,8 +363,10 @@ jobs:
344363
steps:
345364
- name: Support longpaths
346365
run: git config --system core.longpaths true
347-
- uses: actions/checkout@v4
348-
- uses: actions/setup-java@v4
366+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
367+
with:
368+
persist-credentials: false
369+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
349370
with:
350371
distribution: temurin
351372
java-version: 11
@@ -360,10 +381,11 @@ jobs:
360381
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
361382
runs-on: ubuntu-latest
362383
steps:
363-
- uses: actions/checkout@v4
384+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
364385
with:
365386
fetch-depth: 0
366-
- uses: actions/setup-java@v4
387+
persist-credentials: false
388+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
367389
with:
368390
distribution: temurin
369391
java-version: 17
@@ -381,8 +403,10 @@ jobs:
381403
- name: Get current week within the year
382404
id: date
383405
run: echo "::set-output name=week_of_year::$(date +'%W' --utc)"
384-
- uses: actions/checkout@v4
385-
- uses: actions/setup-java@v4
406+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
407+
with:
408+
persist-credentials: false
409+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
386410
with:
387411
distribution: temurin
388412
java-version: 11
@@ -399,8 +423,10 @@ jobs:
399423
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
400424
runs-on: ubuntu-latest
401425
steps:
402-
- uses: actions/checkout@v4
403-
- uses: actions/setup-java@v4
426+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
427+
with:
428+
persist-credentials: false
429+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
404430
with:
405431
java-version: 11
406432
distribution: temurin
@@ -410,7 +436,7 @@ jobs:
410436
env:
411437
JOB_TYPE: install
412438
- name: Validate gapic-libraries-bom
413-
uses: googleapis/java-cloud-bom/tests/validate-bom@v26.79.0
439+
uses: googleapis/java-cloud-bom/tests/validate-bom@377c8d1fac6b1521dc52a10f4d02e5d371a0de67 # v26.79.0
414440
with:
415441
bom-path: gapic-libraries-bom/pom.xml
416442

.github/workflows/create_additional_release_tag.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
permissions:
2+
contents: read
3+
14
name: Create additional tags for each release
25

36
on:
@@ -13,9 +16,10 @@ jobs:
1316
contents: write
1417
steps:
1518
- name: Checkout code
16-
uses: actions/checkout@v4
19+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
1720
with:
1821
token: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
22+
persist-credentials: false
1923
- name: Set up Git
2024
run: |
2125
git config --local user.email "action@github.com"

.github/workflows/google-auth-library-java-ci.yaml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# limitations under the License.
1414
# GitHub action job to test core java library features on
1515
# downstream client libraries before they are released.
16+
permissions:
17+
contents: read
18+
1619
on:
1720
push:
1821
branches:
@@ -27,7 +30,9 @@ jobs:
2730
outputs:
2831
library: ${{ steps.filter.outputs.library }}
2932
steps:
30-
- uses: actions/checkout@v4
33+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
34+
with:
35+
persist-credentials: false
3136
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
3237
id: filter
3338
with:
@@ -44,8 +49,10 @@ jobs:
4449
matrix:
4550
java: [11, 17, 21, 25, 26]
4651
steps:
47-
- uses: actions/checkout@v4
48-
- uses: actions/setup-java@v4
52+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
53+
with:
54+
persist-credentials: false
55+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
4956
with:
5057
distribution: temurin
5158
java-version: ${{matrix.java}}
@@ -60,8 +67,10 @@ jobs:
6067
if: ${{ needs.filter.outputs.library == 'true' }}
6168
runs-on: ubuntu-latest
6269
steps:
63-
- uses: actions/checkout@v3
64-
- uses: actions/setup-java@v3
70+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
71+
with:
72+
persist-credentials: false
73+
- uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3
6574
with:
6675
distribution: temurin
6776
java-version: 11
@@ -75,8 +84,10 @@ jobs:
7584
if: ${{ needs.filter.outputs.library == 'true' }}
7685
runs-on: ubuntu-latest
7786
steps:
78-
- uses: actions/checkout@v4
79-
- uses: actions/setup-java@v4
87+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
88+
with:
89+
persist-credentials: false
90+
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
8091
with:
8192
distribution: temurin
8293
java-version: 17
@@ -92,4 +103,4 @@ jobs:
92103
if: ${{ contains(needs.*.result, 'failure') }}
93104
run: exit 1
94105
- name: Success otherwise
95-
run: echo "Success!"
106+
run: echo "Success!"

0 commit comments

Comments
 (0)