Skip to content

Commit bb7a499

Browse files
authored
ci: Don't push docker image with dependabot (#702)
1 parent 0028ace commit bb7a499

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ jobs:
182182
runs-on: ubuntu-latest
183183
if: |
184184
!cancelled()
185+
env:
186+
MULTI_ARCH_BUILD: ${{ ((github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push') && github.actor != 'dependabot[bot]') && 'true' || 'false' }}
185187
steps:
186188
- uses: actions/checkout@v4
187189
with:
@@ -218,9 +220,9 @@ jobs:
218220
context: .
219221
cache-from: type=gha,scope=prod
220222
cache-to: type=gha,mode=max,scope=prod
221-
platforms: ${{ (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
222-
push: ${{ (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push') && 'true' || 'false' }}
223-
load: ${{ (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push') && 'false' || 'true' }}
223+
platforms: ${{ env.MULTI_ARCH_BUILD == 'true' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
224+
push: ${{ env.MULTI_ARCH_BUILD }}
225+
load: ${{ !env.MULTI_ARCH_BUILD }}
224226
tags: ghcr.io/getsentry/spotlight:${{ github.sha }}
225227

226228
- name: Test Docker Image

0 commit comments

Comments
 (0)