Skip to content

Commit f3aa324

Browse files
committed
fix high priority findings
1 parent fab6c89 commit f3aa324

6 files changed

Lines changed: 58 additions & 6 deletions

File tree

.github/workflows/checks.yml

Lines changed: 8 additions & 1 deletion
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"
@@ -44,6 +45,9 @@ jobs:
4445
check_integration_test_labels:
4546
# This check fails if integration tests are queued, in progress, or failed.
4647
runs-on: ubuntu-22.04
48+
permissions:
49+
contents: read
50+
pull-requests: read
4751
steps:
4852
- uses: docker://index.docker.io/agilepathway/pull-request-label-checker@sha256:14f5f3dfda922496d07d53494e2d2b42885165f90677a1c03d600059b7706a61 # ratchet:docker://agilepathway/pull-request-label-checker:latest
4953
with:
@@ -53,6 +57,9 @@ jobs:
5357
generated_docs_check:
5458
# This check succeeds if Doxygen documentation generates without errors.
5559
runs-on: ubuntu-22.04
60+
permissions:
61+
contents: read
62+
pull-requests: write
5663
steps:
5764
- uses: lukka/get-cmake@591817e96fcad43505fb4eae36172462abb3a42e # ratchet:lukka/get-cmake@latest
5865
with:

.github/workflows/checks_secure.yml

Lines changed: 3 additions & 0 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

.github/workflows/cpp-packaging.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ jobs:
566566
tools_platform=darwin
567567
fi
568568
verbose_flag=
569-
if [[ -n "${{ github.event.inputs.verboseBuild }}" && "${{ github.event.inputs.verboseBuild }}" -ne 0 ]]; then
569+
if [[ -n "${GITHUB_EVENT_INPUTS_VERBOSEBUILD}" && "${GITHUB_EVENT_INPUTS_VERBOSEBUILD}" -ne 0 ]]; then
570570
verbose_flag=-v
571571
fi
572572
declare -a additional_flags
@@ -606,6 +606,8 @@ jobs:
606606
fi
607607
cd firebase-cpp-sdk-${{ matrix.sdk_platform }}${{ matrix.suffix }}-package
608608
tar -czhf ../firebase-cpp-sdk-${{ matrix.sdk_platform }}${{ matrix.suffix }}-package.tgz .
609+
env:
610+
GITHUB_EVENT_INPUTS_VERBOSEBUILD: ${{ github.event.inputs.verboseBuild }}
609611

610612
- name: Print package contents
611613
shell: bash

.github/workflows/integration_tests.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ on:
4242
firestore_dep_source:
4343
description: 'Optional: Where to get firestore iOS SDK from: "RELEASED", "TIP" or "<git-commit> from firestore-ios-sdk"'
4444

45-
permissions: write-all
45+
permissions:
46+
contents: read
4647

4748
env:
4849
triggerLabelPrefix: "tests-requested: "
@@ -57,6 +58,10 @@ env:
5758
jobs:
5859
check_and_prepare:
5960
runs-on: ubuntu-22.04
61+
permissions:
62+
contents: read
63+
pull-requests: write
64+
actions: write
6065
outputs:
6166
trigger: ${{ steps.set_outputs.outputs.trigger }}
6267
github_ref: ${{ steps.set_outputs.outputs.github_ref }}
@@ -265,6 +270,9 @@ jobs:
265270
name: build-desktop-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.ssl_variant }}
266271
needs: [check_and_prepare]
267272
runs-on: ${{ matrix.os }}
273+
permissions:
274+
contents: read
275+
pull-requests: write
268276
# Skip this if there is an empty matrix (which can happen if "auto" was set above).
269277
# But check cancelled() && !failure() so it runs even if check_trigger was skipped.
270278
if: contains(needs.check_and_prepare.outputs.matrix_platform, 'Desktop') && needs.check_and_prepare.outputs.apis != '' && !cancelled() && !failure()
@@ -462,6 +470,9 @@ jobs:
462470
name: build-android-${{ matrix.os }}
463471
needs: [check_and_prepare]
464472
runs-on: ${{ matrix.os }}
473+
permissions:
474+
contents: read
475+
pull-requests: write
465476
if: contains(needs.check_and_prepare.outputs.matrix_platform, 'Android') && needs.check_and_prepare.outputs.apis != '' && !cancelled() && !failure()
466477
strategy:
467478
fail-fast: false
@@ -604,6 +615,9 @@ jobs:
604615
name: build-ios-${{ matrix.os }}
605616
needs: [check_and_prepare]
606617
runs-on: ${{ matrix.os }}
618+
permissions:
619+
contents: read
620+
pull-requests: write
607621
if: contains(needs.check_and_prepare.outputs.matrix_platform, 'iOS') && needs.check_and_prepare.outputs.apis != '' && !cancelled() && !failure()
608622
strategy:
609623
fail-fast: false
@@ -724,6 +738,9 @@ jobs:
724738
name: build-tvos-${{ matrix.os }}
725739
needs: [check_and_prepare]
726740
runs-on: ${{ matrix.os }}
741+
permissions:
742+
contents: read
743+
pull-requests: write
727744
if: contains(needs.check_and_prepare.outputs.matrix_platform, 'tvOS') && needs.check_and_prepare.outputs.apis != '' && !cancelled() && !failure()
728745
strategy:
729746
fail-fast: false
@@ -841,6 +858,9 @@ jobs:
841858
name: test-desktop-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.ssl_variant }}
842859
needs: [check_and_prepare, build_desktop]
843860
runs-on: ${{ matrix.os }}
861+
permissions:
862+
contents: read
863+
pull-requests: write
844864
if: contains(needs.check_and_prepare.outputs.matrix_platform, 'Desktop') && needs.check_and_prepare.outputs.apis != '' && !cancelled()
845865
strategy:
846866
fail-fast: false
@@ -986,6 +1006,9 @@ jobs:
9861006
name: test-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}
9871007
needs: [check_and_prepare, build_android]
9881008
runs-on: ubuntu-22.04
1009+
permissions:
1010+
contents: read
1011+
pull-requests: write
9891012
if: contains(needs.check_and_prepare.outputs.matrix_platform, 'Android') && needs.check_and_prepare.outputs.apis != '' && !cancelled()
9901013
strategy:
9911014
fail-fast: false
@@ -1130,6 +1153,9 @@ jobs:
11301153
name: test-ios-${{ matrix.build_os }}-${{ matrix.ios_device }}-${{ matrix.test_type }}
11311154
needs: [check_and_prepare, build_ios]
11321155
runs-on: macos-15
1156+
permissions:
1157+
contents: read
1158+
pull-requests: write
11331159

11341160
if: contains(needs.check_and_prepare.outputs.matrix_platform, 'iOS') && needs.check_and_prepare.outputs.apis != '' && !cancelled()
11351161
strategy:
@@ -1317,6 +1343,9 @@ jobs:
13171343
name: test-tvos-${{ matrix.build_os }}-${{ matrix.tvos_device }}
13181344
needs: [check_and_prepare, build_tvos]
13191345
runs-on: macos-15
1346+
permissions:
1347+
contents: read
1348+
pull-requests: write
13201349
if: contains(needs.check_and_prepare.outputs.matrix_platform, 'tvOS') && needs.check_and_prepare.outputs.apis != '' && !cancelled()
13211350
strategy:
13221351
fail-fast: false
@@ -1468,6 +1497,10 @@ jobs:
14681497
name: "summarize-results"
14691498
needs: [check_and_prepare, test_desktop, test_android, test_ios, test_tvos]
14701499
runs-on: ubuntu-22.04
1500+
permissions:
1501+
contents: read
1502+
pull-requests: write
1503+
issues: write
14711504
if: ${{ !cancelled() }}
14721505
steps:
14731506
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3
@@ -1546,6 +1579,8 @@ jobs:
15461579
name: "attempt-retry"
15471580
needs: [check_and_prepare, summarize_results]
15481581
runs-on: ubuntu-22.04
1582+
permissions:
1583+
contents: read
15491584
if: ${{ failure() && needs.check_and_prepare.outputs.trigger == 'scheduled_trigger' }}
15501585
steps:
15511586
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3

.github/workflows/reviewer-roulette.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
# Get the current reviewers and the author of the PR, to exclude them from the list.
4242
# Duplicates don't matter, so get the list of requested reviewers *and* the list of
4343
# completed reviews.
44-
requested_reviewers='${{ join(github.event.pull_request.requested_reviewers.*.login, ' ') }} '
45-
completed_reviewers='${{ join(fromJSON(env.PR_REVIEWS).*.user.login, ' ') }} '
44+
requested_reviewers='${REQUESTED_REVIEWERS} '
45+
completed_reviewers='${COMPLETED_REVIEWERS} '
4646
author="${GITHUB_EVENT_PULL_REQUEST_USER_LOGIN}"
4747
echo "Requested reviewers: ${requested_reviewers}"
4848
echo "Completed reviewers: ${completed_reviewers}"
@@ -71,6 +71,8 @@ jobs:
7171
echo "::warning ::No reviewers available"
7272
fi
7373
env:
74+
COMPLETED_REVIEWERS: ${{ join(fromJSON(env.PR_REVIEWS).*.user.login, ' ') }}
75+
REQUESTED_REVIEWERS: ${{ join(github.event.pull_request.requested_reviewers.*.login, ' ') }}
7476
GITHUB_EVENT_PULL_REQUEST_USER_LOGIN: ${{ github.event.pull_request.user.login }}
7577

7678
- name: Choose random reviewer

.github/workflows/update-feature-branches.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ on:
1313
schedule:
1414
- cron: "0 16 * * 1" # Mondays, 4pm UTC = 9am PST / 10am PDT
1515

16-
permissions: write-all
16+
permissions:
17+
contents: read
1718

1819
env:
1920
defaultBranchPattern: "feature_branch/*"
@@ -64,6 +65,8 @@ jobs:
6465
name: create-merge-pr-${{ matrix.branch_name }}
6566
needs: [ list_feature_branches ]
6667
runs-on: ubuntu-22.04
68+
permissions:
69+
contents: write
6770
if: ${{ needs.list_feature_branches.outputs.branch_list != '[]' }}
6871
strategy:
6972
fail-fast: false

0 commit comments

Comments
 (0)