Skip to content

Commit 456d31f

Browse files
authored
Rework tag generation. (#1740)
Signed-off-by: Josh Baird <[email protected]>
1 parent 1f87640 commit 456d31f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/build-op-image.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ jobs:
113113
tags: |
114114
type=raw,value=latest,enable=${{ github.ref_type == 'tag' }}
115115
type=ref,event=tag
116-
type=semver,pattern={{version}}
117-
type=semver,pattern={{major}}.{{minor}}
118-
type=sha,format=long,prefix=,enable=${{ github.event_name == 'pull_request' }},priority=1000
116+
type=semver,pattern={{version}},enable=${{ github.ref_type == 'tag' }}
117+
type=semver,pattern={{major}}.{{minor}},enable=${{ github.ref_type == 'tag' }}
118+
type=sha,format=long,prefix=,priority=1000
119119
120120
- name: Build and push image (pull request)
121121
if: github.event_name == 'pull_request'
@@ -133,9 +133,9 @@ jobs:
133133
GO_VERSION=${{ steps.setup-go.outputs.go-version }}
134134
outputs: type=image,"name=${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=true
135135

136-
- name: Build and push image (tag)
136+
- name: Build and push image
137137
if: github.event_name != 'pull_request'
138-
id: build-tag
138+
id: build
139139
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
140140
with:
141141
context: .
@@ -155,7 +155,7 @@ jobs:
155155
platform="${{ matrix.platform }}"
156156
# Convert "linux/amd64" to just amd64 for the output variable name
157157
arch=${platform#linux/}
158-
echo "${arch}=${{ steps.build-pr.outputs.digest || steps.build-tag.outputs.digest }}" >> $GITHUB_OUTPUT
158+
echo "${arch}=${{ steps.build-pr.outputs.digest || steps.build.outputs.digest }}" >> $GITHUB_OUTPUT
159159
160160
manifest:
161161
name: Publish image manifest

0 commit comments

Comments
 (0)