Skip to content

Commit 23e2ed6

Browse files
authored
Merge pull request #78 from crazy-max/gha-perms
ci: set contents read as default workflow permissions
2 parents b570770 + abc5012 commit 23e2ed6

File tree

5 files changed

+53
-14
lines changed

5 files changed

+53
-14
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ concurrency:
44
group: ${{ github.workflow }}-${{ github.ref }}
55
cancel-in-progress: true
66

7+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
8+
permissions:
9+
contents: read
10+
711
on:
812
push:
913
branches:
@@ -135,6 +139,9 @@ jobs:
135139

136140
release:
137141
runs-on: ubuntu-latest
142+
permissions:
143+
# required to create GitHub release
144+
contents: write
138145
needs:
139146
- artifact
140147
- test
@@ -175,6 +182,11 @@ jobs:
175182

176183
image:
177184
runs-on: ubuntu-latest
185+
permissions:
186+
# same as global permissions
187+
contents: read
188+
# required to push to GHCR
189+
packages: write
178190
needs:
179191
- artifact
180192
- test

.github/workflows/codeql.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ concurrency:
44
group: ${{ github.workflow }}-${{ github.ref }}
55
cancel-in-progress: true
66

7+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
8+
permissions:
9+
contents: read
10+
711
on:
812
schedule:
913
- cron: '0 12 * * 6'
@@ -17,6 +21,11 @@ on:
1721
jobs:
1822
codeql:
1923
runs-on: ubuntu-latest
24+
permissions:
25+
# same as global permissions
26+
contents: read
27+
# required for code scanning
28+
security-events: write
2029
steps:
2130
-
2231
name: Checkout

.github/workflows/labels.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,36 @@ concurrency:
44
group: ${{ github.workflow }}-${{ github.ref }}
55
cancel-in-progress: true
66

7+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
8+
permissions:
9+
contents: read
10+
711
on:
812
push:
913
branches:
1014
- 'master'
1115
paths:
1216
- '.github/labels.yml'
1317
- '.github/workflows/labels.yml'
18+
pull_request:
19+
paths:
20+
- '.github/labels.yml'
21+
- '.github/workflows/labels.yml'
1422

1523
jobs:
1624
labeler:
1725
runs-on: ubuntu-latest
26+
permissions:
27+
# same as global permissions
28+
contents: read
29+
# required to update labels
30+
issues: write
1831
steps:
1932
-
2033
name: Checkout
2134
uses: actions/checkout@v4
2235
-
2336
name: Run Labeler
2437
uses: crazy-max/ghaction-github-labeler@v5
38+
with:
39+
dry-run: ${{ github.event_name == 'pull_request' }}

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ concurrency:
44
group: ${{ github.workflow }}-${{ github.ref }}
55
cancel-in-progress: true
66

7+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
8+
permissions:
9+
contents: read
10+
711
on:
812
push:
913
branches:

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,19 @@ yasu nobody true
9292
Following platforms for this image are available:
9393

9494
```
95-
$ docker run --rm mplatform/mquery crazymax/yasu:latest
96-
Image: crazymax/yasu:latest
97-
* Manifest List: Yes
98-
* Supported platforms:
99-
- linux/386
100-
- linux/amd64
101-
- linux/arm/v5
102-
- linux/arm/v6
103-
- linux/arm/v7
104-
- linux/arm64
105-
- linux/mips64le
106-
- linux/ppc64le
107-
- linux/riscv64
108-
- linux/s390x
95+
$ docker buildx imagetools inspect crazymax/yasu --format "{{json .Manifest}}" | \
96+
jq -r '.manifests[] | select(.platform.os != null and .platform.os != "unknown") | .platform | "\(.os)/\(.architecture)\(if .variant then "/" + .variant else "" end)"'
97+
98+
linux/386
99+
linux/amd64
100+
linux/arm/v5
101+
linux/arm/v6
102+
linux/arm/v7
103+
linux/arm64
104+
linux/mips64le
105+
linux/ppc64le
106+
linux/riscv64
107+
linux/s390x
109108
```
110109

111110
Here is how to use `yasu` inside your Dockerfile:

0 commit comments

Comments
 (0)