From 2a67673753125643554fa1d0ba800a352a9b24a5 Mon Sep 17 00:00:00 2001 From: "maximilian.schubert@telekom.de" Date: Thu, 30 Nov 2023 08:43:04 +0100 Subject: [PATCH] feat: get go mod version for build --- .github/workflows/artifacts.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index b090abe1..412d2949 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -50,6 +50,10 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=raw,value=latest,enable={{is_default_branch}} + + - name: Get go mod version + id: go-version + run: go mod edit -json | jq -r .Go | { read value; echo "value=$value"; } >> "$GITHUB_OUTPUT" - name: Build image id: build @@ -59,7 +63,9 @@ jobs: load: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - build-args: VERSION=${{ github.ref_name }} + build-args: | + GO_VERSION=${{ steps.go-version.outputs.value }} + VERSION=${{ github.ref_name }} - name: Set image ref id: image-ref @@ -96,5 +102,7 @@ jobs: platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - build-args: VERSION=${{ github.ref_name }} + build-args: | + GO_VERSION=${{ steps.go-version.outputs.value }} + VERSION=${{ github.ref_name }} if: inputs.push