Skip to content

Commit

Permalink
ops: don't push if dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
Zibbp committed Feb 21, 2025
1 parent f19f6e3 commit 7366543
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/docker-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Login into GitHub Container Registry except on PR
# Login into GitHub Container Registry (only if OCI_PUSH is true and not run by Dependabot)
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
if: env.OCI_PUSH == 'true'
if: env.OCI_PUSH == 'true' && github.actor != 'dependabot[bot]'
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -97,6 +97,7 @@ jobs:
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
if: env.OCI_PUSH == 'true' && github.actor != 'dependabot[bot]'
with:
push: ${{ env.OCI_PUSH == 'true' }}
platforms: ${{ matrix.platform }}
Expand All @@ -115,7 +116,7 @@ jobs:
- name: Upload digest
uses: actions/upload-artifact@v4
if: env.OCI_PUSH == 'true'
if: env.OCI_PUSH == 'true' && github.actor != 'dependabot[bot]'
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: ${{ runner.temp }}/digests/*
Expand All @@ -124,7 +125,7 @@ jobs:

merge:
runs-on: ubuntu-latest
if: vars.OCI_PUSH == 'true'
if: vars.OCI_PUSH == 'true' && github.actor != 'dependabot[bot]'
needs:
- build
steps:
Expand All @@ -144,6 +145,7 @@ jobs:

- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
if: github.actor != 'dependabot[bot]'
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand Down

0 comments on commit 7366543

Please sign in to comment.