Skip to content

Commit 2e1bc0e

Browse files
committed
Only do Docker GHCR login when needed
Signed-off-by: Martijn Stevenson <[email protected]>
1 parent 5220cbd commit 2e1bc0e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,18 +279,19 @@ jobs:
279279
steps:
280280
- uses: actions/checkout@v2
281281

282+
- name: Install dependencies (Linux)
283+
if: ${{ matrix.deps != '' && startsWith(matrix.os, 'ubuntu') }}
284+
run: sudo apt update -y && sudo apt install -y ${{ matrix.deps }}
285+
282286
# Needed for s390x test which runs on a GHCR Docker Ubuntu image.
283287
- name: Login to GitHub Container Registry
288+
if: startsWith(matrix.run_under, 'docker')
284289
uses: docker/login-action@v3
285290
with:
286291
registry: ghcr.io
287292
username: ${{ github.actor }}
288293
password: ${{ secrets.GITHUB_TOKEN }}
289294

290-
- name: Install dependencies (Linux)
291-
if: ${{ matrix.deps != '' && startsWith(matrix.os, 'ubuntu') }}
292-
run: sudo apt update -y && sudo apt install -y ${{ matrix.deps }}
293-
294295
- name: Activate Docker/QEMU
295296
if: startsWith(matrix.run_under, 'docker')
296297
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

0 commit comments

Comments
 (0)