From 74a15c7d4919e6357f35508a4039ed9e48f68c77 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Sun, 15 Nov 2026 00:44:05 -0600 Subject: [PATCH 1/2] Use Docker Hub OIDC for publish workflow login Replace the DOCKER_USERNAME/DOCKER_PASSWORD secrets with an OIDC (workload identity federation) login to Docker Hub. The docker job now grants id-token: write and passes the OIDC connection ID via the DOCKERHUB_OIDC_CONNECTIONID repository variable. --- .github/workflows/publish.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index a29971aa223c..ca56bfff930d 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -99,6 +99,12 @@ jobs: docker: runs-on: ubuntu-latest + permissions: + contents: read + # Required so GitHub can issue an OIDC token for the Docker Hub login. + id-token: write + # Required to push images to ghcr.io. + packages: write env: GITHUB_TOKEN: ${{ github.token }} TAG: ${{ inputs.version || github.ref_name }} @@ -112,10 +118,16 @@ jobs: - uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0 - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 - - uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 + # Authenticates to Docker Hub via OIDC (workload identity federation) + # instead of a stored username/password. Requires an OIDC connection + # configured for the org in Docker Home (Identity & auth > OIDC + # connections) and the `id-token: write` permission above. + - name: Login to Docker Hub with OIDC + uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + username: codercom + env: + DOCKERHUB_OIDC_CONNECTIONID: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }} - uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 with: registry: ghcr.io From d5abb51851c0953790660bac157fe22e06a85aeb Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Sun, 15 Nov 2026 00:51:03 -0600 Subject: [PATCH 2/2] Run docker publish job in the release environment Scopes the Docker Hub OIDC subject claim to repo:coder/code-server:environment:release. --- .github/workflows/publish.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index ca56bfff930d..5644cc7a8462 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -99,6 +99,9 @@ jobs: docker: runs-on: ubuntu-latest + # Scopes the Docker Hub OIDC subject claim to + # repo:coder/code-server:environment:release. + environment: release permissions: contents: read # Required so GitHub can issue an OIDC token for the Docker Hub login.