set the docker config in a step, not the job's env

The runner context does not exist at job level, so naming it there is a syntax
error and the workflow fails before a step runs. RUNNER_TEMP is the same value
and is an ordinary variable once a step is running.

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-09-09 07:58:03 -07:00
co-authored by Hanzo Dev
parent ddcf55fd87
commit 1f94c45090
+18 -10
View File
@@ -31,13 +31,17 @@ jobs:
- arch: arm64 - arch: arm64
pool: linux-arm64 pool: linux-arm64
runs-on: ['${{ matrix.pool }}'] runs-on: ['${{ matrix.pool }}']
env:
# Each runner gets its own, because five services share this
# machine’s HOME and docker/login-action logs out when a job ends —
# taking the credential from whichever job is still pushing.
DOCKER_CONFIG: ${{ runner.temp }}/docker
timeout-minutes: 60 timeout-minutes: 60
steps: steps:
# One docker config per RUNNER: several runner services share this
# machine’s HOME, and docker/login-action logs out in its post step,
# so a job that finishes takes the credential from a job still
# pushing. Set here rather than in the job env, where the runner
# context does not exist and naming it is a syntax error.
- name: One docker config per runner
run: |
d="$RUNNER_TEMP/docker"; mkdir -p "$d"
echo "DOCKER_CONFIG=$d" >> "$GITHUB_ENV"
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: docker/login-action@v3 - uses: docker/login-action@v3
with: with:
@@ -59,14 +63,18 @@ jobs:
merge: merge:
needs: image needs: image
runs-on: [linux-amd64] runs-on: [linux-amd64]
env:
# Each runner gets its own, because five services share this
# machine’s HOME and docker/login-action logs out when a job ends —
# taking the credential from whichever job is still pushing.
DOCKER_CONFIG: ${{ runner.temp }}/docker
permissions: permissions:
packages: write packages: write
steps: steps:
# One docker config per RUNNER: several runner services share this
# machine’s HOME, and docker/login-action logs out in its post step,
# so a job that finishes takes the credential from a job still
# pushing. Set here rather than in the job env, where the runner
# context does not exist and naming it is a syntax error.
- name: One docker config per runner
run: |
d="$RUNNER_TEMP/docker"; mkdir -p "$d"
echo "DOCKER_CONFIG=$d" >> "$GITHUB_ENV"
- uses: docker/login-action@v3 - uses: docker/login-action@v3
with: with:
registry: ghcr.io registry: ghcr.io