Skip to content

Commit aa74e45

Browse files
committed
ci: enhance Docker workflow to handle pull requests
1 parent 26c0dff commit aa74e45

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Create and publish a Docker image
22

33
on:
44
workflow_dispatch:
5+
pull_request:
56
push:
67
branches:
78
- "master"
@@ -42,11 +43,12 @@ jobs:
4243
uses: docker/build-push-action@v6
4344
with:
4445
context: .
45-
push: true
46+
push: ${{ github.event_name != 'pull_request' }}
4647
tags: ${{ steps.meta.outputs.tags }}
4748
labels: ${{ steps.meta.outputs.labels }}
4849

4950
- name: Generate artifact attestation
51+
if: github.event_name != 'pull_request'
5052
uses: actions/attest-build-provenance@v2
5153
with:
5254
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}

0 commit comments

Comments
 (0)