From f75a2f99f985d3407fb8efa309ea5eb6508557b8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 1 Sep 2026 14:26:10 +0000 Subject: [PATCH] ci: skip Docker Hub login and push for PR/Dependabot runs Co-authored-by: beevelop <6891349+beevelop@users.noreply.github.com> --- .github/workflows/docker.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d557ef3..7a4f2e6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -14,6 +14,9 @@ jobs: main: runs-on: ubuntu-latest timeout-minutes: 30 + env: + # Docker Hub credentials are not available for pull requests and Dependabot runs + publish: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }} steps: - name: Check out the repo uses: actions/checkout@v7 @@ -33,6 +36,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - name: Login to Docker Hub + if: env.publish == 'true' uses: docker/login-action@v4.6.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -48,8 +52,9 @@ jobs: id: docker_build uses: docker/build-push-action@v7 with: - platforms: ${{ env.platforms }} - push: ${{ github.event_name != 'pull_request' }} + platforms: ${{ env.publish == 'true' && env.platforms || 'linux/amd64' }} + push: ${{ env.publish == 'true' }} + load: ${{ env.publish != 'true' }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} cache-from: type=local,src=${{ github.workspace }}/cache