Skip to content

Commit ceb4cad

Browse files
authored
[backport] ci: add workflow permissions for security (#912) (#914)
1 parent ae8fa23 commit ceb4cad

File tree

7 files changed

+29
-74
lines changed

7 files changed

+29
-74
lines changed

.github/workflows/build-pipy-images.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
required: true
99
type: string
1010

11+
permissions:
12+
contents: read
13+
packages: write
14+
1115
jobs:
1216
debian:
1317
name: Build pipy debian images

.github/workflows/e2e.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ env:
4343
CTR_REGISTRY: ${{ vars.CI_CTR_REGISTRY || 'localhost:5000' }}
4444
CTR_TAG: ${{ github.sha }}
4545

46+
permissions:
47+
contents: read
48+
packages: write
49+
4650
jobs:
4751
e2e-test:
4852
name: e2e

.github/workflows/ghcr.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
- "scripts/cleanup/**"
2323
- "CODEOWNERS"
2424
- "OWNERS"
25+
2526
env:
2627
CI_WAIT_FOR_OK_SECONDS: 180
2728
CI_MAX_ITERATIONS_THRESHOLD: 0 #unlimited
@@ -38,6 +39,11 @@ env:
3839
FSM_DEMO_IMAGE_ARTIFACTS_NAME: ${{ vars.FSM_DEMO_IMAGE_ARTIFACTS_NAME || 'fsm-demo-images' }}
3940
FSM_CLI_ARTIFACTS_NAME: ${{ vars.FSM_CLI_ARTIFACTS_NAME || 'fsm-cli' }}
4041

42+
permissions:
43+
contents: read
44+
packages: write
45+
actions: read
46+
4147
jobs:
4248
shellcheck:
4349
name: Shellcheck

.github/workflows/release-image.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ on:
3232
type: string
3333
default: nonroot
3434

35+
permissions:
36+
contents: read
37+
packages: write
38+
3539
jobs:
3640
build:
3741
runs-on: ubuntu-24.04

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
tags:
55
- "v*.*.*"
66

7+
permissions:
8+
contents: read
9+
packages: write
10+
actions: read
11+
712
jobs:
813
version:
914
name: Set Version from git ref

.github/workflows/slash-commands.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ on:
33
issue_comment:
44
types: [created]
55

6+
permissions:
7+
contents: read
8+
issues: write
9+
pull-requests: write
10+
actions: read
11+
612
jobs:
713
run:
814
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)