File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ concurrency:
1616env :
1717 REGISTRY : ghcr.io
1818 IMAGE_NAME : ${{ github.repository }}
19+ # Set to 'true' to allow pushing container from pull requests with the label 'push-container'
20+ PUSH_FROM_PR : ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'push-container') }}
1921
2022jobs :
2123 docker-build :
@@ -67,14 +69,14 @@ jobs:
6769 with :
6870 context : .
6971 platforms : linux/amd64, linux/arm64
70- push : ${{ github.event_name != 'pull_request' }}
72+ push : ${{ github.event_name != 'pull_request' || env.PUSH_FROM_PR == 'true' }}
7173 tags : ${{ steps.meta.outputs.tags }}
7274 labels : ${{ steps.meta.outputs.labels }}
7375 cache-from : type=gha
7476 cache-to : type=gha,mode=max
7577
7678 - name : Generate artifact attestation
77- if : github.event_name != 'pull_request'
79+ if : github.event_name != 'pull_request' || env.PUSH_FROM_PR == 'true'
7880 uses : actions/attest-build-provenance@v2
7981 with :
8082 subject-name : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
You can’t perform that action at this time.
0 commit comments