From 6c0c29f53ed4e5e2627b86e7451b19802282334f Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 20 Jun 2025 19:13:32 +0000 Subject: [PATCH] fix: Add Docker login and permissions to CI workflow This commit fixes the Docker image push failure in the CI workflow by adding the necessary Docker login step and ensuring the correct permissions are set for the GITHUB_TOKEN. - Added a Docker login step using `docker/login-action@v3` to the `Build Docker Image` job in `.github/workflows/ci.yaml`. This authenticates to GHCR before attempting to push images. - Added a `permissions` block to the `Build Docker Image` job, granting `packages: write` scope to the `GITHUB_TOKEN`. This is required to allow pushing packages to the GitHub Container Registry. --- .github/workflows/ci.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3cde71c..d7f5a0e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,6 +27,9 @@ jobs: build: name: Build Docker Image runs-on: ubuntu-latest + permissions: + contents: read # Needed to checkout the repository + packages: write # Needed to push Docker images to GHCR steps: - name: Check out code uses: actions/checkout@v3 @@ -50,6 +53,13 @@ jobs: # Tag with 'latest' if on the main branch (though this workflow only runs on PRs to main) type=ref,event=branch,pattern=main,value=latest + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build Docker image uses: docker/build-push-action@v4 with: