Skip to content

Commit 93fbdbe

Browse files
committed
chore: test global permissions
1 parent 068d9b8 commit 93fbdbe

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/docker-publish.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ on:
1212
env:
1313
IMAGE_NAME: ${{ github.repository }}
1414
DOCKERHUB_USERNAME: c4illin
15-
GHCR_USERNAME: c4illin
1615

1716
concurrency:
1817
group: ${{ github.workflow }}-${{ github.ref }}
1918
cancel-in-progress: true
2019

20+
permissions:
21+
contents: write
22+
packages: write
23+
2124
jobs:
2225
# The build job builds the Docker image for each platform specified in the matrix.
2326
build:
@@ -33,7 +36,7 @@ jobs:
3336
packages: write
3437
attestations: write
3538
checks: write
36-
actions: read
39+
actions: write
3740

3841
runs-on: ${{ matrix.platform == 'linux/amd64' && 'ubuntu-24.04' || matrix.platform == 'linux/arm64' && 'ubuntu-24.04-arm' }}
3942

@@ -73,8 +76,8 @@ jobs:
7376
uses: docker/login-action@v3
7477
with:
7578
registry: ghcr.io
76-
username: ${{ env.GHCR_USERNAME }}
77-
password: ${{ secrets.GHCR_TOKEN }}
79+
username: ${{ github.actor }}
80+
password: ${{ secrets.GITHUB_TOKEN }}
7881

7982
- name: Build and push by digest
8083
id: build
@@ -142,8 +145,8 @@ jobs:
142145
uses: docker/login-action@v3
143146
with:
144147
registry: ghcr.io
145-
username: ${{ env.GHCR_USERNAME }}
146-
password: ${{ secrets.GHCR_TOKEN }}
148+
username: ${{ github.actor }}
149+
password: ${{ secrets.GITHUB_TOKEN }}
147150

148151
- name: Login to Docker Hub
149152
uses: docker/login-action@v3

0 commit comments

Comments
 (0)