Skip to content

Commit 46044cb

Browse files
committed
Fix top level permissions in workflows
Permissions should be read only by default Related to #174 Signed-off-by: James Taylor <[email protected]>
1 parent 8ff524b commit 46044cb

File tree

10 files changed

+45
-11
lines changed

10 files changed

+45
-11
lines changed

.github/workflows/docker-build.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ on:
1616
required: false
1717
type: string
1818

19-
permissions:
20-
contents: read
21-
packages: write
22-
id-token: write
23-
2419
jobs:
2520
build:
2621
runs-on: ubuntu-latest
2722
outputs:
2823
image_digest: ${{ steps.push.outputs.digest }}
2924

25+
permissions:
26+
contents: read
27+
packages: write
28+
id-token: write
29+
3030
steps:
3131
- name: Checkout
3232
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -66,6 +66,11 @@ jobs:
6666
needs: build
6767
runs-on: ubuntu-latest
6868

69+
permissions:
70+
contents: write
71+
packages: write
72+
id-token: write
73+
6974
steps:
7075
- name: Checkout
7176
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

.github/workflows/go-contract-image.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ on:
1414
paths:
1515
- 'samples/go-contract/**'
1616

17+
permissions: read-all
18+
1719
jobs:
20+
permissions:
21+
contents: write
22+
packages: write
23+
id-token: write
1824
docker_build:
1925
name: Docker build
2026
uses: ./.github/workflows/docker-build.yml

.github/workflows/go.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ on:
1515
- 'docs/**'
1616
- 'samples/**'
1717

18+
permissions: read-all
19+
1820
jobs:
1921

2022
build:
@@ -24,6 +26,9 @@ jobs:
2426
os: [ubuntu-latest, macOS-13]
2527
goarch: [amd64, arm64]
2628

29+
permissions:
30+
contents: write
31+
2732
env:
2833
GOARCH: ${{ matrix.goarch }}
2934

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ on:
1515
- 'docs/**'
1616
- 'samples/**'
1717

18-
permissions:
19-
contents: read
18+
permissions: read-all
2019

2120
jobs:
2221
golangci:

.github/workflows/java-contract-image.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ on:
1414
paths:
1515
- 'samples/java-contract/**'
1616

17+
permissions: read-all
18+
1719
jobs:
20+
permissions:
21+
contents: write
22+
packages: write
23+
id-token: write
1824
docker_build:
1925
name: Docker build
2026
uses: ./.github/workflows/docker-build.yml

.github/workflows/mkdocs.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ on:
1111
- 'docs/**'
1212
workflow_dispatch:
1313

14-
permissions:
15-
contents: read
16-
pages: write
17-
id-token: write
14+
permissions: read-all
1815

1916
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
2017
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
@@ -54,6 +51,10 @@ jobs:
5451
# Deployment job
5552
deploy:
5653
if: github.event_name == 'push'
54+
permissions:
55+
contents: read
56+
pages: write
57+
id-token: write
5758
environment:
5859
name: github-pages
5960
url: ${{ steps.deployment.outputs.page_url }}

.github/workflows/node-contract-image.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ on:
1414
paths:
1515
- 'samples/node-contract/**'
1616

17+
permissions: read-all
18+
1719
jobs:
20+
permissions:
21+
contents: write
22+
packages: write
23+
id-token: write
1824
docker_build:
1925
name: Docker build
2026
uses: ./.github/workflows/docker-build.yml

.github/workflows/peer-image.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ on:
1818
- 'docs/**'
1919
- 'samples/**'
2020

21+
permissions: read-all
22+
2123
jobs:
2224
docker_build:
2325
name: Docker build

.github/workflows/status-checks-docker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Skip docker status checks
33
on:
44
workflow_call:
55

6+
permissions: read-all
7+
68
jobs:
79
build:
810
runs-on: ubuntu-latest

.github/workflows/status-checks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- 'docs/**'
88
- 'samples/**'
99

10+
permissions: read-all
11+
1012
jobs:
1113
lint:
1214
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)