Skip to content

Commit 54643d4

Browse files
committed
chore: harden GitHub Actions workflows against Zizmor findings
* Add top-level permissions: contents: read to publish and post_summaries workflows * Pin dart-lang/ecosystem workflows to immutable commit SHAs * Set persist-credentials: false on actions/checkout steps * Add cooldown configuration to dependabot.yml * Add ignore annotation for workflow_run dangerous triggers
1 parent 6b84f81 commit 54643d4

7 files changed

Lines changed: 21 additions & 3 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ updates:
88
directory: /
99
schedule:
1010
interval: monthly
11+
cooldown:
12+
default-days: 7
1113
labels:
1214
- autosubmit
1315
groups:

.github/workflows/js_interop.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131

3232
steps:
3333
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
34+
with:
35+
persist-credentials: false
3436
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
3537
with:
3638
sdk: ${{ matrix.sdk }}

.github/workflows/js_interop_gen.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131

3232
steps:
3333
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
34+
with:
35+
persist-credentials: false
3436
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
3537
with:
3638
node-version: 22
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
# A workflow to allow other workflow to comment on PRs.
22

33
name: Comment on the pull request
4+
permissions:
5+
contents: read
46

57
on:
68
# Trigger this workflow after the Health workflow completes. This workflow
79
# will have permissions to do things like create comments on the PR, even if
810
# the original workflow couldn't.
9-
workflow_run:
11+
workflow_run: # zizmor: ignore[dangerous-triggers]
1012
workflows:
1113
- Publish
1214
types:
1315
- completed
1416

1517
jobs:
1618
upload:
17-
uses: dart-lang/ecosystem/.github/workflows/post_summaries.yaml@main
19+
uses: dart-lang/ecosystem/.github/workflows/post_summaries.yaml@ed9c592c1d35106c0a8a52044426515017a60646
1820
permissions:
1921
pull-requests: write

.github/workflows/publish.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# A CI configuration to auto-publish pub packages.
22

33
name: Publish
4+
permissions:
5+
contents: read
46

57
on:
68
pull_request:
@@ -11,7 +13,7 @@ on:
1113
jobs:
1214
publish:
1315
if: ${{ github.repository_owner == 'dart-lang' }}
14-
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
16+
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@ed9c592c1d35106c0a8a52044426515017a60646
1517
with:
1618
write-comments: false
1719
permissions:

.github/workflows/web.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131

3232
steps:
3333
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
34+
with:
35+
persist-credentials: false
3436
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
3537
with:
3638
sdk: ${{ matrix.sdk }}

.github/workflows/web_generator.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232

3333
steps:
3434
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
35+
with:
36+
persist-credentials: false
3537
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
3638
with:
3739
sdk: ${{ matrix.sdk }}
@@ -49,6 +51,8 @@ jobs:
4951

5052
steps:
5153
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
54+
with:
55+
persist-credentials: false
5256
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
5357

5458
- run: npm install
@@ -64,6 +68,8 @@ jobs:
6468

6569
steps:
6670
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
71+
with:
72+
persist-credentials: false
6773
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
6874

6975
- run: npm install

0 commit comments

Comments
 (0)