Skip to content

Commit

Permalink
Don't do extra builds on merge_group builds
Browse files Browse the repository at this point in the history
* Adjust the condition for the `isPR` matrix key to be true, by
  checking the github event name: it's true if the event was
  pull_request or merge_group.

* Adjust all other github.event_name conditions to use the matrix.isPR
  context key.
  • Loading branch information
antifuchs committed Aug 26, 2023
1 parent 469a510 commit c7469d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- linux/amd64
- linux/arm64
isPR:
- ${{github.event_name == 'pull_request'}}
- ${{github.event_name == 'pull_request' || github.event_name == 'merge_group'}}

# Run only the amd64 build in pull reqs:
exclude:
Expand All @@ -53,7 +53,7 @@ jobs:
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
if: matrix.isPR == false
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
Expand All @@ -76,7 +76,7 @@ jobs:
with:
context: .
platforms: ${{ matrix.platform }}
push: ${{ github.event_name != 'pull_request' }}
push: ${{ matrix.isPR }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-to: type=gha,mode=max
Expand Down

0 comments on commit c7469d5

Please sign in to comment.