File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,18 @@ jobs:
137
137
flavor : |
138
138
latest=auto
139
139
140
+ - name : Get version info
141
+ id : version
142
+ run : |
143
+ VERSION="${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}"
144
+ if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
145
+ LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
146
+ SHORT_SHA=$(git rev-parse --short HEAD)
147
+ VERSION="${LATEST_TAG}-develop-${SHORT_SHA}"
148
+ fi
149
+ echo "Version: ${VERSION}"
150
+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
151
+
140
152
- name : Set up QEMU
141
153
uses : docker/setup-qemu-action@v3
142
154
@@ -157,7 +169,7 @@ jobs:
157
169
labels : ${{ steps.meta.outputs.labels }}
158
170
build-args : |
159
171
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
160
- VERSION=${{ fromJSON( steps.meta .outputs.json).labels['org.opencontainers.image. version'] }}
172
+ VERSION=${{ steps.version .outputs.version }}
161
173
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
162
174
cache-from : type=gha
163
175
cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments