|
27 | 27 | matrix: |
28 | 28 | images: ${{ fromJson(vars.IMAGES) }} |
29 | 29 | steps: |
| 30 | + - name: Get PR branch |
| 31 | + if: github.event.issue.pull_request |
| 32 | + id: pr-branch |
| 33 | + uses: xt0rted/pull-request-comment-branch@v3 |
| 34 | + |
30 | 35 | - name: Set up QEMU |
31 | 36 | uses: docker/setup-qemu-action@v3 |
32 | 37 |
|
@@ -63,17 +68,16 @@ jobs: |
63 | 68 | type=ref,event=pr,enable=${{ github.event.pull_request.merged == false }} |
64 | 69 | # Tag with the PR base branch name on merge |
65 | 70 | type=raw,value=${{ github.event.pull_request.base.ref }},enable=${{ github.event.pull_request.merged == true }} |
66 | | - # Manual/scheduled runs tag by branch ref (for whichever release branch the run targets) |
| 71 | + # Manual/scheduled runs tag by branch ref |
67 | 72 | type=ref,event=branch,enable=${{ contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) }} |
68 | 73 | # Comment-triggered builds: pr-<num> |
69 | | - type=raw,event=default,value=pr-${{ github.event.issue.number }},enable=${{ github.event.issue.pull_request != null }} |
70 | | - # Supported release branches |
71 | | - type=raw,value=5.x,enable=${{ github.ref == 'refs/heads/5.x' || github.event.pull_request.base.ref == '5.x' }} |
72 | | - type=raw,value=6.x,enable=${{ github.ref == 'refs/heads/6.x' || github.event.pull_request.base.ref == '6.x' }} |
73 | | - type=raw,value=7.x,enable=${{ github.ref == 'refs/heads/7.x' || github.event.pull_request.base.ref == '7.x' }} |
| 74 | + type=raw,value=pr-${{ github.event.issue.number }},enable=${{ github.event.issue.pull_request != null }} |
| 75 | + # Supported release branches - use the fetched branch name for comments |
| 76 | + type=raw,value=5.x,enable=${{ github.ref_name == '5.x' || github.event.pull_request.base.ref == '5.x' || steps.pr-branch.outputs.base_ref == '5.x' }} |
| 77 | + type=raw,value=6.x,enable=${{ github.ref_name == '6.x' || github.event.pull_request.base.ref == '6.x' || steps.pr-branch.outputs.base_ref == '6.x' }} |
| 78 | + type=raw,value=7.x,enable=${{ github.ref_name == '7.x' || github.event.pull_request.base.ref == '7.x' || steps.pr-branch.outputs.base_ref == '7.x' }} |
74 | 79 | # Always add an immutable sha tag |
75 | | - type=raw,value=sha-${{ github.event.issue.pull_request && 'manual' || github.sha }},enable=false |
76 | | - type=raw,value=sha-${{ github.event.pull_request.head.sha || github.sha }},enable=${{ github.event_name == 'pull_request' || github.event.issue.pull_request != null }} |
| 80 | + type=raw,value=sha-${{ github.event.pull_request.head.sha || steps.pr-branch.outputs.head_sha || github.sha }} |
77 | 81 | labels: | |
78 | 82 | maintainer=Victorian Department of Government Services |
79 | 83 | repository=${{ github.repositoryUrl }} |
|
0 commit comments