Skip to content

Commit 20db628

Browse files
authored
Merge pull request #481 from klueska/update-ci-version-string
Update the version used during CI to match ${VERSION}-${SHORT_GIT_SHA}
2 parents c0046b4 + 2e7e6cd commit 20db628

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/variables.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
workflow_call:
1717
outputs:
1818
version:
19-
description: "The short SHA to use as a version string"
19+
description: "The version string with the commit short SHA attached"
2020
value: ${{ jobs.variables.outputs.version }}
2121
golang_version:
2222
description: "The golang version for this project"
@@ -32,9 +32,9 @@ jobs:
3232
- name: Check out code
3333
uses: actions/checkout@v5
3434

35-
- name: Generate Commit Short SHA
35+
- name: Get Version with Commit Short SHA
3636
id: version
37-
run: echo "version=$(echo $GITHUB_SHA | cut -c1-8)" >> "$GITHUB_OUTPUT"
37+
run: echo "version=$(make print-VERSION)-$(echo $GITHUB_SHA | cut -c1-8)" >> "$GITHUB_OUTPUT"
3838

3939
- name: Get Golang Version
4040
id: golang_version

versions.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ BUILDIMAGE_TAG ?= devel-go$(GOLANG_VERSION)
3636
BUILDIMAGE ?= $(DRIVER_NAME):$(BUILDIMAGE_TAG)
3737

3838
GIT_COMMIT ?= $(shell git describe --match="" --dirty --long --always --abbrev=40 2> /dev/null || echo "")
39+
40+
print-%:
41+
@echo $($*)

0 commit comments

Comments
 (0)