From 93922faf91a34f0a50383d4e4fc4a4fb33f4f8e8 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Wed, 24 Jun 2026 11:43:03 -0400 Subject: [PATCH] Key Docker Hub namespace off push credential Derive the Docker Hub namespace from DOCKER_NAMESPACE, falling back to DOCKER_USERNAME and then github.repository_owner, so forks whose GitHub owner name differs from their writable Docker Hub namespace can push. GHCR is unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/test-build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index a6983e326..3539c4e65 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -40,6 +40,8 @@ jobs: env: USE_GHCR: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.registry == 'ghcr' || github.event.inputs.registry == 'both' }} USE_DOCKERHUB: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.registry == 'dockerhub' || github.event.inputs.registry == 'both') }} + # Key the Docker Hub namespace off the push credential rather than the GitHub owner. + DOCKERHUB_NAMESPACE: ${{ secrets.DOCKER_NAMESPACE || secrets.DOCKER_USERNAME || github.repository_owner }} steps: - name: Run only once per workflow run: echo "Triggered by ${{ github.event_name }}" @@ -91,7 +93,7 @@ jobs: with: images: | ${{ env.USE_GHCR == 'true' && format('name=ghcr.io/{0}/romm-testing', github.repository_owner) || '' }} - ${{ env.USE_DOCKERHUB == 'true' && format('name={0}/romm-testing', github.repository_owner) || '' }} + ${{ env.USE_DOCKERHUB == 'true' && format('name={0}/romm-testing', env.DOCKERHUB_NAMESPACE) || '' }} tags: | type=raw,value=${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.head_ref }}