Skip to content

Commit 0bcd72c

Browse files
authored
build: use raw instead of match for stable tag metadata (#2251)
1 parent ae46cd3 commit 0bcd72c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/build-multiarch.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,16 @@ jobs:
125125
type=ref,event=tag,enable=${{ matrix.variant == env.MAIN_VARIANT }}
126126
# and each variant (including main one) gets the tag with the variant suffix, such as 2023.1.1-java17
127127
type=ref,event=tag,suffix=-${{ matrix.variant }}
128-
# latest repo tag gets a moving 'stable' image tag applied to the main variant
129-
type=match,value=stable,enable=${{ matrix.variant == env.MAIN_VARIANT }},pattern=\d+\.\d+\.\d+
130128
# for building test/* branch images
131-
type=ref,event=branch,suffix=-${{ matrix.variant }},enable=${{ github.ref_name != 'master' }}
132-
#
133-
type=raw,value=${{ matrix.variant }},enable=${{ github.ref_name == 'master' }}
129+
type=ref,event=branch,suffix=-${{ matrix.variant }},enable=${{ github.ref_name != github.event.repository.default_branch }}
130+
# latest repo tag gets a moving 'stable' image tag applied to the main variant
131+
type=raw,value=stable,enable=${{ github.ref_type == 'tag' && matrix.variant == env.MAIN_VARIANT }}
132+
# apply the variant as a moving tag for most recent commit per variant
133+
type=raw,value=${{ matrix.variant }},enable=${{ github.ref_name == github.event.repository.default_branch }}
134134
# NOTE this identifies which variant will be published as "latest", which isn't
135135
# necessarily the newest version of Java
136136
flavor: |
137-
latest=${{ matrix.variant == env.MAIN_VARIANT && github.ref_name == 'master' }}
137+
latest=${{ matrix.variant == env.MAIN_VARIANT && github.ref_name == github.event.repository.default_branch }}
138138
labels: |
139139
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
140140
@@ -191,7 +191,7 @@ jobs:
191191
push: >
192192
${{
193193
github.ref_type == 'tag'
194-
|| github.ref_name == 'master'
194+
|| github.ref_name == github.event.repository.default_branch
195195
|| startsWith(github.ref_name, 'test/')
196196
|| ( github.event_name == 'pull_request'
197197
&& env.HAS_IMAGE_REPO_ACCESS

0 commit comments

Comments
 (0)