Skip to content

Commit 1fcfcca

Browse files
authored
Enable pushes only for the default branch (#60)
1 parent 0927ae4 commit 1fcfcca

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/main.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Build and push the container image
33

44
on: # yamllint disable-line rule:truthy
55
push:
6+
branches:
7+
- master
68
pull_request:
79
release:
810
types: [published]
@@ -38,7 +40,8 @@ jobs:
3840
"${{ env.CONTAINER_IMAGE_ID }}"
3941
"ghcr.io/${{ env.CONTAINER_IMAGE_ID }}"
4042
tags: |
41-
type=ref,event=branch,enable={{is_default_branch}}
43+
type=ref,event=branch
44+
type=ref,event=pr
4245
type=semver,pattern={{version}}
4346
type=semver,pattern={{major}}.{{minor}}.{{patch}}
4447
type=semver,pattern={{major}}.{{minor}}
@@ -80,8 +83,7 @@ jobs:
8083
username: ${{ github.repository_owner }}
8184
password: ${{ secrets.GITHUB_TOKEN }}
8285

83-
- id: build-and-push
84-
name: Build and push the container image
86+
- name: Build and push the container image
8587
uses: docker/build-push-action@v3
8688
with:
8789
cache-from: type=gha

0 commit comments

Comments
 (0)