Skip to content

Commit 4f28492

Browse files
fix(ci): add missing permissions and protoc dependencies (#9912)
* fix(workflows): add missing permissions and protoc dependencies
1 parent 40f042f commit 4f28492

5 files changed

Lines changed: 69 additions & 1 deletion

File tree

.github/workflows/book.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ jobs:
4444
mdbook-version: ~0.4
4545
use-linkcheck: true
4646
use-mermaid: true
47+
- name: Install last version of Protoc
48+
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b #v3.0.0
49+
with:
50+
repo-token: ${{ secrets.GITHUB_TOKEN }}
4751
- uses: actions-rust-lang/setup-rust-toolchain@ab6845274e2ff01cd4462007e1a9d9df1ab49f42 #v1.14.0
4852
with:
4953
toolchain: nightly

.github/workflows/coverage.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ jobs:
4141
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
4242
with:
4343
persist-credentials: false
44+
- name: Install last version of Protoc
45+
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b #v3.0.0
46+
with:
47+
repo-token: ${{ secrets.GITHUB_TOKEN }}
4448
- uses: actions-rust-lang/setup-rust-toolchain@ab6845274e2ff01cd4462007e1a9d9df1ab49f42 #v1.14.0
4549
with:
4650
toolchain: stable

.github/workflows/release-binaries.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ jobs:
2121
# The image will be named `zebra:<semver>`
2222
build:
2323
name: Build Release Docker
24+
permissions:
25+
contents: read
26+
id-token: write
27+
pull-requests: write
2428
uses: ./.github/workflows/zfnd-build-docker-image.yml
2529
with:
2630
dockerfile_path: ./docker/Dockerfile

.github/workflows/zfnd-ci-integration-tests-gcp.yml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ on:
105105

106106
permissions:
107107
contents: read
108-
pull-requests: read
109108

110109
env:
111110
CARGO_TERM_COLOR: always
@@ -129,7 +128,9 @@ jobs:
129128
# Skip PRs from external repositories, let them pass, and then GitHub's Merge Queue will check them
130129
if: ${{ (!startsWith(github.event_name, 'pull') || !github.event.pull_request.head.repo.fork) && (github.event_name != 'pull_request' || github.event.label.name == 'run-stateful-tests') }}
131130
permissions:
131+
contents: read
132132
id-token: write
133+
pull-requests: write
133134
statuses: write
134135
uses: ./.github/workflows/zfnd-build-docker-image.yml
135136
with:
@@ -155,6 +156,9 @@ jobs:
155156
name: Check if cached state disks exist for ${{ inputs.network || vars.ZCASH_NETWORK }}
156157
# Skip PRs from external repositories, let them pass, and then GitHub's Merge Queue will check them
157158
if: ${{ (!startsWith(github.event_name, 'pull') || !github.event.pull_request.head.repo.fork) && (github.event_name != 'pull_request' || github.event.label.name == 'run-stateful-tests') }}
159+
permissions:
160+
contents: read
161+
id-token: write
158162
uses: ./.github/workflows/zfnd-find-cached-disks.yml
159163
with:
160164
network: ${{ inputs.network || vars.ZCASH_NETWORK }}
@@ -166,6 +170,9 @@ jobs:
166170
get-available-disks-testnet:
167171
name: Check if cached state disks exist for testnet
168172
if: ${{ (!startsWith(github.event_name, 'pull') || !github.event.pull_request.head.repo.fork) && (github.event_name != 'pull_request' || github.event.label.name == 'run-stateful-tests') }}
173+
permissions:
174+
contents: read
175+
id-token: write
169176
uses: ./.github/workflows/zfnd-find-cached-disks.yml
170177
with:
171178
network: Testnet
@@ -182,6 +189,9 @@ jobs:
182189
sync-to-mandatory-checkpoint:
183190
name: Zebra checkpoint
184191
needs: [build, get-available-disks]
192+
permissions:
193+
contents: read
194+
id-token: write
185195
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
186196
if: ${{ !fromJSON(needs.get-available-disks.outputs.zebra_checkpoint_disk) || github.event.inputs.regenerate-disks == 'true' }}
187197
concurrency:
@@ -208,6 +218,9 @@ jobs:
208218
sync-past-mandatory-checkpoint:
209219
name: Zebra checkpoint update
210220
needs: [sync-to-mandatory-checkpoint, get-available-disks]
221+
permissions:
222+
contents: read
223+
id-token: write
211224
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
212225
if: ${{ !cancelled() && !failure() && (fromJSON(needs.get-available-disks.outputs.zebra_checkpoint_disk) || needs.sync-to-mandatory-checkpoint.result == 'success') && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }}
213226
with:
@@ -235,6 +248,9 @@ jobs:
235248
sync-full-mainnet:
236249
name: Zebra tip
237250
needs: [build, get-available-disks]
251+
permissions:
252+
contents: read
253+
id-token: write
238254
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
239255
if: ${{ github.event_name == 'schedule' || !fromJSON(needs.get-available-disks.outputs.zebra_tip_disk) || (github.event.inputs.run-full-sync == 'true' && (inputs.network || vars.ZCASH_NETWORK) == 'Mainnet') }}
240256
concurrency:
@@ -265,6 +281,9 @@ jobs:
265281
sync-update-mainnet:
266282
name: Zebra tip update
267283
needs: [sync-full-mainnet, get-available-disks]
284+
permissions:
285+
contents: read
286+
id-token: write
268287
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
269288
if: ${{ !cancelled() && !failure() && (fromJSON(needs.get-available-disks.outputs.zebra_tip_disk) || needs.sync-full-mainnet.result == 'success') && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }}
270289
with:
@@ -294,6 +313,9 @@ jobs:
294313
generate-checkpoints-mainnet:
295314
name: Generate checkpoints mainnet
296315
needs: [sync-full-mainnet, get-available-disks]
316+
permissions:
317+
contents: read
318+
id-token: write
297319
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
298320
if: ${{ !cancelled() && !failure() && (fromJSON(needs.get-available-disks.outputs.zebra_tip_disk) || needs.sync-full-mainnet.result == 'success') && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }}
299321
with:
@@ -325,6 +347,9 @@ jobs:
325347
sync-full-testnet:
326348
name: Zebra tip on testnet
327349
needs: [build, get-available-disks-testnet]
350+
permissions:
351+
contents: read
352+
id-token: write
328353
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
329354
if: ${{ !fromJSON(needs.get-available-disks-testnet.outputs.zebra_tip_disk) || (github.event.inputs.run-full-sync == 'true' && (inputs.network || vars.ZCASH_NETWORK) == 'Testnet') }}
330355
concurrency:
@@ -358,6 +383,9 @@ jobs:
358383
generate-checkpoints-testnet:
359384
name: Generate checkpoints testnet
360385
needs: [sync-full-testnet, get-available-disks-testnet]
386+
permissions:
387+
contents: read
388+
id-token: write
361389
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
362390
if: ${{ !cancelled() && !failure() && (fromJSON(needs.get-available-disks-testnet.outputs.zebra_tip_disk) || needs.sync-full-testnet.result == 'success') && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }}
363391
with:
@@ -387,6 +415,9 @@ jobs:
387415
lwd-sync-full:
388416
name: lightwalletd tip
389417
needs: [sync-full-mainnet, get-available-disks]
418+
permissions:
419+
contents: read
420+
id-token: write
390421
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
391422
# Currently the lightwalletd tests only work on Mainnet
392423
if: ${{ !cancelled() && !failure() && (inputs.network || vars.ZCASH_NETWORK) == 'Mainnet' && (fromJSON(needs.get-available-disks.outputs.zebra_tip_disk) || needs.sync-full-mainnet.result == 'success') && (github.event_name == 'schedule' || !fromJSON(needs.get-available-disks.outputs.lwd_tip_disk) || github.event.inputs.run-lwd-sync == 'true' ) }}
@@ -417,6 +448,9 @@ jobs:
417448
lwd-sync-update:
418449
name: lightwalletd tip update
419450
needs: [lwd-sync-full, get-available-disks]
451+
permissions:
452+
contents: read
453+
id-token: write
420454
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
421455
if: ${{ !cancelled() && !failure() && (inputs.network || vars.ZCASH_NETWORK) == 'Mainnet' && (fromJSON(needs.get-available-disks.outputs.lwd_tip_disk) || needs.lwd-sync-full.result == 'success') && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }}
422456
with:
@@ -444,6 +478,9 @@ jobs:
444478
lwd-rpc-test:
445479
name: Zebra tip JSON-RPC
446480
needs: [sync-full-mainnet, get-available-disks]
481+
permissions:
482+
contents: read
483+
id-token: write
447484
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
448485
if: ${{ !cancelled() && !failure() && (inputs.network || vars.ZCASH_NETWORK) == 'Mainnet' && (fromJSON(needs.get-available-disks.outputs.zebra_tip_disk) || needs.sync-full-mainnet.result == 'success') && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }}
449486
with:
@@ -465,6 +502,9 @@ jobs:
465502
lwd-rpc-send-tx:
466503
name: Lightwalletd send transactions
467504
needs: [lwd-sync-full, get-available-disks]
505+
permissions:
506+
contents: read
507+
id-token: write
468508
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
469509
if: ${{ !cancelled() && !failure() && (inputs.network || vars.ZCASH_NETWORK) == 'Mainnet' && (fromJSON(needs.get-available-disks.outputs.lwd_tip_disk) || needs.lwd-sync-full.result == 'success') && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }}
470510
with:
@@ -487,6 +527,9 @@ jobs:
487527
lwd-grpc-wallet:
488528
name: lightwalletd GRPC tests
489529
needs: [lwd-sync-full, get-available-disks]
530+
permissions:
531+
contents: read
532+
id-token: write
490533
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
491534
if: ${{ !cancelled() && !failure() && (inputs.network || vars.ZCASH_NETWORK) == 'Mainnet' && (fromJSON(needs.get-available-disks.outputs.lwd_tip_disk) || needs.lwd-sync-full.result == 'success') && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }}
492535
with:
@@ -513,6 +556,9 @@ jobs:
513556
rpc-get-block-template:
514557
name: get block template
515558
needs: [sync-full-mainnet, get-available-disks]
559+
permissions:
560+
contents: read
561+
id-token: write
516562
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
517563
if: ${{ !cancelled() && !failure() && (fromJSON(needs.get-available-disks.outputs.zebra_tip_disk) || needs.sync-full-mainnet.result == 'success') && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }}
518564
with:
@@ -535,6 +581,9 @@ jobs:
535581
rpc-submit-block:
536582
name: submit block
537583
needs: [sync-full-mainnet, get-available-disks]
584+
permissions:
585+
contents: read
586+
id-token: write
538587
uses: ./.github/workflows/zfnd-deploy-integration-tests-gcp.yml
539588
if: ${{ !cancelled() && !failure() && (fromJSON(needs.get-available-disks.outputs.zebra_tip_disk) || needs.sync-full-mainnet.result == 'success') && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }}
540589
with:

.github/workflows/zfnd-deploy-nodes-gcp.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ jobs:
143143
# PRs from forked repositories are skipped.
144144
get-disk-name:
145145
name: Get disk name
146+
permissions:
147+
contents: read
148+
id-token: write
146149
uses: ./.github/workflows/zfnd-find-cached-disks.yml
147150
if: ${{ !(github.event.pull_request.head.repo.fork) && (github.event_name != 'workflow_dispatch' || inputs.need_cached_disk) }}
148151
with:
@@ -156,6 +159,10 @@ jobs:
156159
# The image will be commonly named `zebrad:<short-hash | github-ref | semver>`
157160
build:
158161
name: Build CD Docker
162+
permissions:
163+
contents: read
164+
id-token: write
165+
pull-requests: write
159166
uses: ./.github/workflows/zfnd-build-docker-image.yml
160167
if: ${{ github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork }}
161168
with:

0 commit comments

Comments
 (0)