Skip to content

Commit b3dbd3b

Browse files
committed
Update workflow branch checks
1 parent edd973d commit b3dbd3b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/docker.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ jobs:
1313
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
1414

1515
- name: Login to dockerhub
16-
if: github.ref == 'refs/heads/master'
16+
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
1717
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
1818
with:
1919
username: ${{ secrets.DOCKER_USERNAME }}
2020
password: ${{ secrets.DOCKER_PASSWORD }}
2121

2222
- name: Login to GitHub
23-
if: github.ref == 'refs/heads/master'
23+
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
2424
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
2525
with:
2626
registry: ghcr.io
@@ -40,9 +40,10 @@ jobs:
4040
type=edge,branch=$repo.default_branch
4141
4242
- name: build+push
43+
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
4344
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
4445
with:
4546
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
46-
push: ${{ github.ref == 'refs/heads/master' }}
47+
push: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
4748
tags: ${{ steps.docker_meta.outputs.tags }}
4849
labels: ${{ steps.docker_meta.outputs.labels }}

0 commit comments

Comments
 (0)