@@ -39,25 +39,26 @@ jobs:
3939 outputs :
4040 image_tag : ${{ steps.set-outputs.outputs.image_tag }}
4141 steps :
42- - name : Extract env vars for main
42+ - name : Extract vars for Pull Request
4343 shell : bash
44- if : ${{ (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main') || (github.event_name != 'pull_request' && github.ref == 'refs/heads/main') }}
45- run : |
46- echo "image_tag=latest" >> $GITHUB_ENV
47- - name : Extract env vars for other branches on PR
48- shell : bash
49- if : ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref != 'main' }}
44+ if : ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
5045 run : |
5146 branch=${{ github.event.pull_request.base.ref }}
52- branch_version="${branch#release/}"
53- echo "image_tag=$branch_version" >> $GITHUB_ENV
54- - name : Extract env vars for other branches on Push
47+ image_tag="latest"
48+ if [[ "$branch" != "main" ]]; then
49+ image_tag="${branch#release/}"
50+ fi
51+ echo "image_tag=image_tag" >> $GITHUB_ENV
52+ - name : Extract vars for Push
5553 shell : bash
56- if : ${{ github.event_name != 'pull_request' && contains( github.ref, 'refs/heads/main') == false }}
54+ if : ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
5755 run : |
5856 branch=$(echo ${GITHUB_REF#refs/heads/})
59- branch_version="${branch#release/}"
60- echo "image_tag=$branch_version" >> $GITHUB_ENV
57+ image_tag="latest"
58+ if [[ "$branch" != "main" ]]; then
59+ image_tag="${branch#release/}"
60+ fi
61+ echo "image_tag=$image_tag" >> $GITHUB_ENV
6162 - name : Set outputs
6263 id : set-outputs
6364 run : |
0 commit comments