Skip to content

Commit 8075958

Browse files
committed
chore(ci): Fix zizmor security findings in workflows
Resolved findings flagged by zizmor: - Added explicit global `contents: read` permissions to `ci.yml`, `nightly.yml`, and `release.yml`. - Configured checkouts to set `persist-credentials: false` in `ci.yml`, `nightly.yml`, and the staging phase of `release.yml`. - Added explicit `persist-credentials: true` with a `# zizmor: ignore[artipacked]` comment to the checkout step in the publishing phase of `release.yml`, where credentials are required for git commands inside `publish_preflight_check.sh`.
1 parent f493fb0 commit 8075958

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Continuous Integration
22

33
on: pull_request
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
build:
710
runs-on: ubuntu-latest
@@ -12,6 +15,8 @@ jobs:
1215

1316
steps:
1417
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # 4.3.1
18+
with:
19+
persist-credentials: false
1520

1621
- name: Set up Python 3.13 for emulator
1722
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
@@ -53,6 +58,8 @@ jobs:
5358
runs-on: ubuntu-latest
5459
steps:
5560
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # 4.3.1
61+
with:
62+
persist-credentials: false
5663
- name: Set up Python 3.9
5764
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
5865
with:

.github/workflows/nightly.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ on:
2222
repository_dispatch:
2323
types: [firebase_nightly_build]
2424

25+
permissions:
26+
contents: read
27+
2528
jobs:
2629
nightly:
2730

@@ -32,6 +35,7 @@ jobs:
3235
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # 4.3.1
3336
with:
3437
ref: ${{ github.event.client_payload.ref || github.ref }}
38+
persist-credentials: false
3539

3640
- name: Set up Python
3741
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ on:
3232
types:
3333
- firebase_build
3434

35+
permissions:
36+
contents: read
37+
3538
jobs:
3639
stage_release:
3740
# To publish a release, merge a PR with the title prefix '[chore] Release ' to main
@@ -47,6 +50,8 @@ jobs:
4750
steps:
4851
- name: Checkout source for staging
4952
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # 4.3.1
53+
with:
54+
persist-credentials: false
5055

5156
- name: Set up Python
5257
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
@@ -106,6 +111,9 @@ jobs:
106111
steps:
107112
- name: Checkout source for publish
108113
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # 4.3.1
114+
with:
115+
# Ignored since the GITHUB_TOKEN needs to be persisted for this workflow.
116+
persist-credentials: true # zizmor: ignore[artipacked]
109117

110118
# Download the artifacts created by the stage_release job.
111119
- name: Download release candidates

0 commit comments

Comments
 (0)