Skip to content

Commit 17198e9

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

File tree

11 files changed

+38
-15
lines changed

11 files changed

+38
-15
lines changed

.github/workflows/docker-build.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ 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

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
jobs:
1818
docker_build:
1919
name: Docker build
20+
permissions:
21+
contents: write
22+
packages: write
23+
id-token: write
2024
uses: ./.github/workflows/docker-build.yml
2125
with:
2226
image-name: ghcr.io/hyperledger-labs/fabric-builder-k8s/sample-go-contract

.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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
jobs:
1818
docker_build:
1919
name: Docker build
20+
permissions:
21+
contents: write
22+
packages: write
23+
id-token: write
2024
uses: ./.github/workflows/docker-build.yml
2125
with:
2226
image-name: ghcr.io/hyperledger-labs/fabric-builder-k8s/sample-java-contract

.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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
jobs:
1818
docker_build:
1919
name: Docker build
20+
permissions:
21+
contents: write
22+
packages: write
23+
id-token: write
2024
uses: ./.github/workflows/docker-build.yml
2125
with:
2226
image-name: ghcr.io/hyperledger-labs/fabric-builder-k8s/sample-node-contract

.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)