Skip to content

Commit 18eb5db

Browse files
authored
Fix Actions issues (#1867)
* run ratchet * run zizmor fix * fix high priority findings * remove uses of deprecated action
1 parent 0c7be47 commit 18eb5db

13 files changed

Lines changed: 335 additions & 233 deletions

.github/workflows/android.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ jobs:
2727
matrix_architecture: ${{ steps.export-result.outputs.matrix_architecture }}
2828
matrix_python_version: ${{ steps.export-result.outputs.matrix_python_version }}
2929
steps:
30-
- uses: actions/checkout@v3
30+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3
3131
with:
3232
submodules: false
33+
persist-credentials: false
3334
- name: Use expanded matrix
3435
if: github.event.inputs.use_expanded_matrix == '1'
3536
run: |
@@ -60,7 +61,7 @@ jobs:
6061
- os: macos-15
6162
architecture: x64
6263
steps:
63-
- uses: lukka/get-cmake@latest
64+
- uses: lukka/get-cmake@591817e96fcad43505fb4eae36172462abb3a42e # ratchet:lukka/get-cmake@latest
6465
with:
6566
cmakeVersion: "~3.31.0"
6667
- name: setup Xcode version (macos)
@@ -91,9 +92,10 @@ jobs:
9192
echo "Enabling expanded build and test matrix."
9293
echo "USE_EXPANDED_MATRIX=1" >> $GITHUB_ENV
9394
94-
- uses: actions/checkout@v3
95+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3
9596
with:
9697
submodules: true
98+
persist-credentials: false
9799

98100
- name: Set env variables for subsequent steps (all)
99101
shell: bash
@@ -105,18 +107,18 @@ jobs:
105107
MATRIX_ARCHITECTURE: ${{ matrix.architecture }}
106108

107109
- name: Setup python
108-
uses: actions/setup-python@v4
110+
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # ratchet:actions/setup-python@v4
109111
with:
110112
python-version: ${{ matrix.python_version }}
111113
architecture: ${{ matrix.architecture }}
112114

113115
- name: Add msbuild to PATH
114116
if: startsWith(matrix.os, 'windows')
115-
uses: microsoft/setup-msbuild@v1.1
117+
uses: microsoft/setup-msbuild@34cfbaee7f672c76950673338facd8a73f637506 # ratchet:microsoft/setup-msbuild@v1.1
116118

117119
- name: Cache NDK
118120
id: cache_ndk
119-
uses: actions/cache@v3
121+
uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # ratchet:actions/cache@v3
120122
with:
121123
path: /tmp/android-ndk-r21e
122124
key: android-ndk-${{ matrix.os }}-r21e
@@ -161,7 +163,7 @@ jobs:
161163
162164
- name: Cache ccache files
163165
id: cache_ccache
164-
uses: actions/cache@v3
166+
uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # ratchet:actions/cache@v3
165167
with:
166168
path: ccache_dir
167169
key: dev-test-ccache-${{ env.MATRIX_UNIQUE_NAME }}

.github/workflows/build-report.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,23 @@ jobs:
2626
if: ${{ matrix.test_set == 'firestore' }}
2727
run: sleep 300
2828
- name: Setup python
29-
uses: actions/setup-python@v4
29+
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # ratchet:actions/setup-python@v4
3030
with:
3131
python-version: 3.9
32-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3
3333
with:
3434
fetch-depth: 0
35+
persist-credentials: false
3536
- name: Install Desktop SDK prerequisites
36-
uses: nick-invision/retry@v2
37+
uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # ratchet:nick-invision/retry@v2
3738
with:
3839
timeout_minutes: 15
3940
max_attempts: 3
4041
command: |
4142
python3 scripts/gha/install_prereqs_desktop.py --gha_build
4243
python3 -m pip install requests python-dateutil progress attrs
4344
- name: Fetch GitHub jobs (with retry)
44-
uses: nick-invision/retry@v2
45+
uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # ratchet:nick-invision/retry@v2
4546
with:
4647
timeout_minutes: 20
4748
max_attempts: 3
@@ -53,7 +54,7 @@ jobs:
5354
fi
5455
python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDays }} --write_cache build_status_short.cache ${extra_flags}
5556
- name: Fetch extended GitHub jobs (with retry)
56-
uses: nick-invision/retry@v2
57+
uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # ratchet:nick-invision/retry@v2
5758
with:
5859
timeout_minutes: 80
5960
max_attempts: 3
@@ -103,7 +104,7 @@ jobs:
103104
run: |
104105
cat comment.md
105106
- name: Update GitHub issue (with retry)
106-
uses: nick-invision/retry@v2
107+
uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # ratchet:nick-invision/retry@v2
107108
with:
108109
timeout_minutes: 5
109110
max_attempts: 3

.github/workflows/checks.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ on:
44
pull_request:
55
types: [opened, reopened, synchronize, labeled, unlabeled]
66

7-
permissions: write-all
7+
permissions:
8+
contents: read
89

910
env:
1011
triggerLabelFull: "tests-requested: full"
@@ -21,11 +22,12 @@ jobs:
2122
file_format_check:
2223
runs-on: ubuntu-22.04
2324
steps:
24-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3
2526
with:
2627
submodules: false
28+
persist-credentials: false
2729
- name: Setup python
28-
uses: actions/setup-python@v4
30+
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # ratchet:actions/setup-python@v4
2931
with:
3032
python-version: 3.9
3133
- name: Install prerequisites
@@ -43,24 +45,31 @@ jobs:
4345
check_integration_test_labels:
4446
# This check fails if integration tests are queued, in progress, or failed.
4547
runs-on: ubuntu-22.04
48+
permissions:
49+
contents: read
50+
pull-requests: read
4651
steps:
47-
- uses: docker://agilepathway/pull-request-label-checker:latest
52+
- uses: docker://index.docker.io/agilepathway/pull-request-label-checker@sha256:14f5f3dfda922496d07d53494e2d2b42885165f90677a1c03d600059b7706a61 # ratchet:docker://agilepathway/pull-request-label-checker:latest
4853
with:
4954
none_of: "${{ env.statusLabelInProgress }},${{ env.statusLabelFailed }},${{ env.triggerLabelFull }},${{ env.triggerLabelQuick }}"
5055
repo_token: ${{ github.token }}
5156

5257
generated_docs_check:
5358
# This check succeeds if Doxygen documentation generates without errors.
5459
runs-on: ubuntu-22.04
60+
permissions:
61+
contents: read
62+
pull-requests: write
5563
steps:
56-
- uses: lukka/get-cmake@latest
64+
- uses: lukka/get-cmake@591817e96fcad43505fb4eae36172462abb3a42e # ratchet:lukka/get-cmake@latest
5765
with:
5866
cmakeVersion: "~3.31.0"
59-
- uses: actions/checkout@v3
67+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3
6068
with:
6169
submodules: false
70+
persist-credentials: false
6271
- name: Setup python
63-
uses: actions/setup-python@v4
72+
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # ratchet:actions/setup-python@v4
6473
with:
6574
python-version: 3.9
6675
- name: Install prerequisites
@@ -95,9 +104,10 @@ jobs:
95104
# Check for Google copyright in each file.
96105
runs-on: ubuntu-22.04
97106
steps:
98-
- uses: actions/checkout@v3
107+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3
99108
with:
100109
submodules: false
110+
persist-credentials: false
101111
- name: Run check_copyright.sh
102112
run: |
103113
set -e
@@ -107,12 +117,13 @@ jobs:
107117
# Check that the readme was updated, unless the PR has a specific label set (env.skipReleaseNotesLabel).
108118
runs-on: ubuntu-22.04
109119
steps:
110-
- uses: actions/checkout@v3
120+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3
111121
# Skip this if the PR has the skipReleaseNotes label or if it's a merge to other than main.
112122
if: ${{!contains(github.event.pull_request.labels.*.name, env.skipReleaseNotesLabel) && (github.event.pull_request.base.ref == 'main')}}
113123
with:
114124
fetch-depth: 0
115125
submodules: false
126+
persist-credentials: false
116127
- name: Check whether release notes have been updated
117128
# Skip this if the PR has the skipReleaseNotes label or if it's a merge to other than main.
118129
if: ${{!contains(github.event.pull_request.labels.*.name, env.skipReleaseNotesLabel) && (github.event.pull_request.base.ref == 'main')}}

.github/workflows/checks_secure.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Checks (secure)
22
# These are run on base branch with read/write access.
33

44
on:
5+
# This trigger is only safe-ish to use if steps are gated behind the
6+
# action-has-permission check.
7+
# zizmor: ignore[dangerous-triggers]
58
pull_request_target:
69
types: [synchronize]
710

@@ -19,19 +22,20 @@ jobs:
1922
steps:
2023
- name: Check user permission
2124
id: check
22-
uses: scherermichael-oss/action-has-permission@1.0.6
25+
uses: scherermichael-oss/action-has-permission@136e061bfe093832d87f090dd768e14e27a740d3 # ratchet:scherermichael-oss/action-has-permission@1.0.6
2326
# This action sets outputs.has-permission to '1' or ''
2427
with:
2528
required-permission: write
2629
env:
2730
GITHUB_TOKEN: ${{ github.token }}
28-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3
2932
if: steps.check.outputs.has-permission != 1 || github.event.pull_request.head.repo.full_name != github.repository
3033
with:
3134
submodules: false
35+
persist-credentials: false
3236
- name: Setup python
3337
if: steps.check.outputs.has-permission != 1 || github.event.pull_request.head.repo.full_name != github.repository
34-
uses: actions/setup-python@v4
38+
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # ratchet:actions/setup-python@v4
3539
with:
3640
python-version: 3.9
3741
- name: Install prerequisites

0 commit comments

Comments
 (0)