From 7c1b73805b63b96bc236c973960aab168c59478a Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 18 Jun 2025 14:24:52 +0200 Subject: [PATCH 1/9] updatecli: converge both golang versions together this can avoid situations when the golang version is released earlier than the microsoft golang version --- .../updatecli.d/bump-go-microsoft-version.sh | 38 ------- ...-release-version.sh => bump-go-version.sh} | 28 ++--- .github/updatecli.d/bump-golang.yml | 54 ++++++---- .github/updatecli.d/bump-microsoft.yml | 100 ------------------ 4 files changed, 48 insertions(+), 172 deletions(-) delete mode 100755 .github/updatecli.d/bump-go-microsoft-version.sh rename .github/updatecli.d/{bump-go-release-version.sh => bump-go-version.sh} (68%) delete mode 100644 .github/updatecli.d/bump-microsoft.yml diff --git a/.github/updatecli.d/bump-go-microsoft-version.sh b/.github/updatecli.d/bump-go-microsoft-version.sh deleted file mode 100755 index bf2f0a01..00000000 --- a/.github/updatecli.d/bump-go-microsoft-version.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -# -# Given the Golang microsoft version this script will bump the version. -# -# This script is executed by the automation we are putting in place -# -# Parameters: -# $1 -> the Golang release version to be bumped. Mandatory. -# -set -euo pipefail -MSG="parameter missing." -GO_RELEASE_VERSION=${1:?$MSG} -OS=$(uname -s| tr '[:upper:]' '[:lower:]') -if [ "${OS}" == "darwin" ] ; then - SED="sed -i .bck" -else - SED="sed -i" -fi - -MAJOR_MINOR_PATCH_VERSION=$(echo "$GO_RELEASE_VERSION" | sed -E -e "s#([0-9]+\.[0-9]+\.[0-9]+).*#\1#g") -SECURITY_VERSION=$(echo "$GO_RELEASE_VERSION" | sed -E -e "s#([0-9]+\.[0-9]+\.[0-9]+)(.+)#\2#g") - -# Gather microsoft/go sha256 values -MSFT_DOWNLOAD_METADATA=$(curl -s -L https://aka.ms/golang/release/latest/go${MAJOR_MINOR_PATCH_VERSION}.assets.json) -MSFT_DOWNLOAD_SHA256_ARM=$(echo $MSFT_DOWNLOAD_METADATA | jq -r ".arches[] | select( .env.GOOS == \"linux\") | select( .env.GOARCH == \"arm64\") | .sha256") -MSFT_DOWNLOAD_SHA256_AMD=$(echo $MSFT_DOWNLOAD_METADATA | jq -r ".arches[] | select( .env.GOOS == \"linux\") | select( .env.GOARCH == \"amd64\") | .sha256") - -echo "Update go version ${GO_RELEASE_VERSION}" - -find "go" -type f -name Dockerfile.tmpl -print0 | - while IFS= read -r -d '' line; do - ${SED} -E -e "s#(ARG SECURITY_VERSION)=.*#\1=${SECURITY_VERSION}#g" "$line" - if echo "$line" | grep -q 'arm' ; then - ${SED} -E -e "s#(ARG MSFT_DOWNLOAD_SHA256)=.+#\1=${MSFT_DOWNLOAD_SHA256_ARM}#g" "$line" - else - ${SED} -E -e "s#(ARG MSFT_DOWNLOAD_SHA256)=.+#\1=${MSFT_DOWNLOAD_SHA256_AMD}#g" "$line" - fi - done diff --git a/.github/updatecli.d/bump-go-release-version.sh b/.github/updatecli.d/bump-go-version.sh similarity index 68% rename from .github/updatecli.d/bump-go-release-version.sh rename to .github/updatecli.d/bump-go-version.sh index 3ba89563..112fe4be 100755 --- a/.github/updatecli.d/bump-go-release-version.sh +++ b/.github/updatecli.d/bump-go-version.sh @@ -1,13 +1,15 @@ #!/usr/bin/env bash # -# Given the Golang release version this script will bump the version. +# Given the Microsoft Golang release version this script will bump the version. # # This script is executed by the automation we are putting in place # -# NOTE: sha256 is retrieved from https://pkg.go.dev/golang.org/x/website/internal/dl?utm_source=godoc +# NOTE: +# * sha256 is retrieved from https://pkg.go.dev/golang.org/x/website/internal/dl?utm_source=godoc +# * sha256 is retrieved from https://aka.ms/golang/release/latest/go${MAJOR_MINOR_PATCH_VERSION}.assets.json # # Parameters: -# $1 -> the Golang release version to be bumped. Mandatory. +# $1 -> the Microsoft Golang release version to be bumped. Mandatory. # set -euo pipefail MSG="parameter missing." @@ -19,20 +21,20 @@ else SED="sed -i" fi -MAJOR_MINOR_VERSION=$(echo "$GO_RELEASE_VERSION" | sed -E -e "s#([0-9]+\.[0-9]+).*#\1#g") +# Process the GO_RELEASE_VERSION to extract major, minor, patch and security versions +MAJOR_MINOR_PATCH_VERSION=$(echo "$GO_RELEASE_VERSION" | sed -E -e "s#([0-9]+\.[0-9]+\.[0-9]+).*#\1#g") +SECURITY_VERSION=$(echo "$GO_RELEASE_VERSION" | sed -E -e "s#([0-9]+\.[0-9]+\.[0-9]+)(.+)#\2#g") + +# Gather golang/go sha256 values GOLANG_DOWNLOAD_SHA256_ARM=$(curl -s -L https://golang.org/dl/\?mode\=json | jq -r ".[] | select( .version | contains(\"go${GO_RELEASE_VERSION}\")) | .files[] | select (.filename | contains(\"go${GO_RELEASE_VERSION}.linux-arm64.tar.gz\")) | .sha256") GOLANG_DOWNLOAD_SHA256_AMD=$(curl -s -L https://golang.org/dl/\?mode\=json | jq -r ".[] | select( .version | contains(\"go${GO_RELEASE_VERSION}\")) | .files[] | select (.filename | contains(\"go${GO_RELEASE_VERSION}.linux-amd64.tar.gz\")) | .sha256") # Gather microsoft/go sha256 values -URL=https://aka.ms/golang/release/latest/go${GO_RELEASE_VERSION}.assets.json -if curl -s -L "$URL" > /dev/null ; then - MSFT_DOWNLOAD_METADATA=$(curl -s -L "$URL") - MSFT_DOWNLOAD_SHA256_ARM=$(echo $MSFT_DOWNLOAD_METADATA | jq -r ".arches[] | select( .env.GOOS == \"linux\") | select( .env.GOARCH == \"arm64\") | .sha256") - MSFT_DOWNLOAD_SHA256_AMD=$(echo $MSFT_DOWNLOAD_METADATA | jq -r ".arches[] | select( .env.GOOS == \"linux\") | select( .env.GOARCH == \"amd64\") | .sha256") - # when a new minor then we use `-1` - # then nex security versions will be `-2`, `-3`, etc, see bump-microsoft.yml - SECURITY_VERSION=-1 -fi +MSFT_DOWNLOAD_METADATA=$(curl -s -L https://aka.ms/golang/release/latest/go${MAJOR_MINOR_PATCH_VERSION}.assets.json) +MSFT_DOWNLOAD_SHA256_ARM=$(echo $MSFT_DOWNLOAD_METADATA | jq -r ".arches[] | select( .env.GOOS == \"linux\") | select( .env.GOARCH == \"arm64\") | .sha256") +MSFT_DOWNLOAD_SHA256_AMD=$(echo $MSFT_DOWNLOAD_METADATA | jq -r ".arches[] | select( .env.GOOS == \"linux\") | select( .env.GOARCH == \"amd64\") | .sha256") + +echo "Update go version ${GO_RELEASE_VERSION}" ## As long as https://golang.org/dl/?mode=json supports only 2 major versions ## and there is a new major release, then it's required to parse https://golang.org/dl diff --git a/.github/updatecli.d/bump-golang.yml b/.github/updatecli.d/bump-golang.yml index fc0705a9..ba6cf798 100644 --- a/.github/updatecli.d/bump-golang.yml +++ b/.github/updatecli.d/bump-golang.yml @@ -16,7 +16,7 @@ scms: actions: default: - title: '[Automation] Bump Golang version to {{ source "latestGoVersion" }}' + title: '[Automation] Bump Golang version to {{ source "latestMicrosotGoVersion" }}' kind: github/pullrequest scmid: githubConfig spec: @@ -26,7 +26,7 @@ actions: - dependencies - backport-skip description: | - See [changelog](https://github.com/golang/go/issues?q=milestone%3AGo{{ source "latestGoVersion" }}+label%3ACherryPickApproved) for {{ source "latestGoVersion" }} + See [changelog](https://github.com/golang/go/issues?q=milestone%3AGo{{ source "golangVersion" }}+label%3ACherryPickApproved) for {{ source "golangVersion" }} sources: minor: @@ -39,75 +39,87 @@ sources: spec: command: echo {{ requiredEnv "GO_MINOR" }} - latestGoVersion: - name: Get Latest Go Release + latestMicrosotGoVersion: + name: Get Latest Microsoft Go Release kind: githubrelease dependson: - minor transformers: - - trimprefix: go + - trimprefix: v spec: - owner: golang + owner: microsoft repository: go token: '{{ requiredEnv "GITHUB_TOKEN" }}' username: '{{ requiredEnv "GITHUB_ACTOR" }}' versionfilter: kind: regex - pattern: go1\.{{ source "minor" }}(\.(\d*))?$ + pattern: v1\.{{ source "minor" }}\.(\d*)(-\d*)$ + + golangVersion: + name: Get golang version + dependson: + - latestMicrosotGoVersion + kind: shell + transformers: + - findsubmatch: + pattern: '^(\d+.\d+.\d+)-(\d+)' + captureindex: 1 + spec: + command: echo {{ source "latestMicrosotGoVersion" }} conditions: dockerTag: - name: Is docker image golang:{{ source "latestGoVersion" }} published + name: Is docker image golang:{{ source "golangVersion" }} published kind: dockerimage spec: image: golang - tag: '{{ source "latestGoVersion" }}' - sourceid: latestGoVersion + tag: '{{ source "golangVersion" }}' + sourceid: golangVersion ## As long as there is a bug see https://github.com/updatecli/updatecli/issues/1849 ## Let's use the shell kind rather than the file kind. ## When fixed then uncomment the code and remove is-already-updated # is: -# name: Is version '{{ source "latestGoVersion" }}' not updated in 'go/Makefile.common'? +# name: Is version '{{ source "golangVersion" }}' not updated in 'go/Makefile.common'? # disablesourceinput: true # kind: file # spec: # file: go/Makefile.common # line: 5 -# content: VERSION := {{ source `latestGoVersion` }} +# content: VERSION := {{ source `golangVersion` }} # failwhen: true is-already-updated: - name: Is version '{{ source "latestGoVersion" }}' not updated in 'go/Makefile.common'? + name: Is version '{{ source "golangVersion" }}' not updated in 'go/Makefile.common'? disablesourceinput: true kind: shell spec: - command: grep 'VERSION := {{ source `latestGoVersion` }}' go/Makefile.common && exit 1 || exit 0 + command: grep 'VERSION := {{ source `golangVersion` }}' go/Makefile.common && exit 1 || exit 0 failwhen: false targets: update-go-version: name: "Update .go-version" - sourceid: latestGoVersion + sourceid: golangVersion scmid: githubConfig kind: file spec: - content: '{{ source "latestGoVersion" }}' + content: '{{ source "golangVersion" }}' file: .go-version matchpattern: '\d+.\d+.\d+' update-go-makefile.common: name: "Update go/Makefile.common" - sourceid: latestGoVersion + sourceid: golangVersion scmid: githubConfig kind: file spec: - content: '{{ source "latestGoVersion" }}' + content: '{{ source "golangVersion" }}' file: go/Makefile.common matchpattern: '\d+.\d+.\d+' update-go-versions: - name: 'Update go version {{ source "latestGoVersion" }}' + name: 'Update go version {{ source "latestMicrosotGoVersion" }}' kind: shell - sourceid: latestGoVersion + sourceid: latestMicrosotGoVersion scmid: githubConfig spec: - command: .github/updatecli.d/bump-go-release-version.sh + command: .github/updatecli.d/bump-go-version.sh environments: - name: PATH diff --git a/.github/updatecli.d/bump-microsoft.yml b/.github/updatecli.d/bump-microsoft.yml deleted file mode 100644 index b3a766e5..00000000 --- a/.github/updatecli.d/bump-microsoft.yml +++ /dev/null @@ -1,100 +0,0 @@ ---- -name: Bump golang-microsoft to latest version -pipelineid: 'bump-golang-microsoft-version-{{ requiredEnv "BRANCH" }}' - -scms: - githubConfig: - kind: github - spec: - user: '{{ requiredEnv "GITHUB_ACTOR" }}' - username: '{{ requiredEnv "GITHUB_ACTOR" }}' - owner: elastic - repository: golang-crossbuild - token: '{{ requiredEnv "GITHUB_TOKEN" }}' - branch: '{{ requiredEnv "BRANCH" }}' - commitusingapi: true - -actions: - default: - title: '[Automation] Bump Microsoft version to {{ source "latestGoVersion" }}' - kind: github/pullrequest - scmid: githubConfig - spec: - automerge: true - labels: - - automation - - dependencies - - backport-skip - description: | - See https://github.com/microsoft/go/releases/v{{ source "latestGoVersion" }} - -sources: - minor: - name: Get minor version - kind: shell - transformers: - - findsubmatch: - pattern: '^\d+.(\d+)' - captureindex: 1 - spec: - command: echo {{ requiredEnv "GO_MINOR" }} - - latestGoVersion: - name: Get Latest Go Release - kind: githubrelease - dependson: - - minor - transformers: - - trimprefix: v - spec: - owner: microsoft - repository: go - token: '{{ requiredEnv "GITHUB_TOKEN" }}' - username: '{{ requiredEnv "GITHUB_ACTOR" }}' - versionfilter: - kind: regex - pattern: v1\.{{ source "minor" }}\.(\d*)(-\d*)$ - - securityVersion: - name: Get security version - dependson: - - latestGoVersion - kind: shell - transformers: - - findsubmatch: - pattern: '^1.{{ source "minor" }}.\d+(-\d+)' - captureindex: 1 - spec: - command: echo {{ source "latestGoVersion" }} - - golangVersion: - name: Get golang version - dependson: - - latestGoVersion - kind: shell - transformers: - - findsubmatch: - pattern: '^(\d+.\d+.\d+)-(\d+)' - captureindex: 1 - spec: - command: echo {{ source "latestGoVersion" }} - -conditions: - is-security-already-updated: - name: Is security version '{{ source "securityVersion" }}' not updated in 'go/base/Dockerfile.tmpl'? - disablesourceinput: true - kind: shell - spec: - command: grep 'ARG SECURITY_VERSION={{ source `securityVersion` }}' go/base/Dockerfile.tmpl && exit 1 || exit 0 - failwhen: false - -targets: - update-go-versions: - name: 'Update go version {{ source "latestGoVersion" }}' - kind: shell - sourceid: latestGoVersion - scmid: githubConfig - spec: - command: .github/updatecli.d/bump-go-microsoft-version.sh - environments: - - name: PATH From 7315e0112f609401868fb4ee15307ed578505352 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 18 Jun 2025 14:40:45 +0200 Subject: [PATCH 2/9] fix --- .github/updatecli.d/bump-go-version.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/updatecli.d/bump-go-version.sh b/.github/updatecli.d/bump-go-version.sh index 112fe4be..db01f787 100755 --- a/.github/updatecli.d/bump-go-version.sh +++ b/.github/updatecli.d/bump-go-version.sh @@ -34,17 +34,15 @@ MSFT_DOWNLOAD_METADATA=$(curl -s -L https://aka.ms/golang/release/latest/go${MAJ MSFT_DOWNLOAD_SHA256_ARM=$(echo $MSFT_DOWNLOAD_METADATA | jq -r ".arches[] | select( .env.GOOS == \"linux\") | select( .env.GOARCH == \"arm64\") | .sha256") MSFT_DOWNLOAD_SHA256_AMD=$(echo $MSFT_DOWNLOAD_METADATA | jq -r ".arches[] | select( .env.GOOS == \"linux\") | select( .env.GOARCH == \"amd64\") | .sha256") -echo "Update go version ${GO_RELEASE_VERSION}" - ## As long as https://golang.org/dl/?mode=json supports only 2 major versions ## and there is a new major release, then it's required to parse https://golang.org/dl ## see https://github.com/elastic/golang-crossbuild/pull/389/commits/d0af04f97a2381630ea5e8da5a99f50cf27856a0 if [ -z "$GOLANG_DOWNLOAD_SHA256_ARM" ] ; then - GOLANG_DOWNLOAD_SHA256_ARM=$(curl -s -L https://golang.org/dl | grep go${GO_RELEASE_VERSION}.linux-arm64.tar.gz -A 5 | grep "" | sed 's#.*##g' | sed 's#" | sed 's#.*##g' | sed 's#" | sed 's#.*##g' | sed 's#" | sed 's#.*##g' | sed 's# Date: Wed, 2 Jul 2025 16:00:58 +0200 Subject: [PATCH 3/9] Apply suggestions from code review Co-authored-by: Dimitrios Liappis --- .github/updatecli.d/bump-golang.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/updatecli.d/bump-golang.yml b/.github/updatecli.d/bump-golang.yml index ba6cf798..8d131530 100644 --- a/.github/updatecli.d/bump-golang.yml +++ b/.github/updatecli.d/bump-golang.yml @@ -16,7 +16,7 @@ scms: actions: default: - title: '[Automation] Bump Golang version to {{ source "latestMicrosotGoVersion" }}' + title: '[Automation] Bump Golang version to {{ source "latestMicrosoftGoVersion" }}' kind: github/pullrequest scmid: githubConfig spec: @@ -39,7 +39,7 @@ sources: spec: command: echo {{ requiredEnv "GO_MINOR" }} - latestMicrosotGoVersion: + latestMicrosoftGoVersion: name: Get Latest Microsoft Go Release kind: githubrelease dependson: @@ -58,14 +58,14 @@ sources: golangVersion: name: Get golang version dependson: - - latestMicrosotGoVersion + - latestMicrosoftGoVersion kind: shell transformers: - findsubmatch: pattern: '^(\d+.\d+.\d+)-(\d+)' captureindex: 1 spec: - command: echo {{ source "latestMicrosotGoVersion" }} + command: echo {{ source "latestMicrosoftGoVersion" }} conditions: dockerTag: @@ -115,9 +115,9 @@ targets: file: go/Makefile.common matchpattern: '\d+.\d+.\d+' update-go-versions: - name: 'Update go version {{ source "latestMicrosotGoVersion" }}' + name: 'Update go version {{ source "latestMicrosoftGoVersion" }}' kind: shell - sourceid: latestMicrosotGoVersion + sourceid: latestMicrosoftGoVersion scmid: githubConfig spec: command: .github/updatecli.d/bump-go-version.sh From 5cbf464facd361d45f7896e706ef67a09a8dd314 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 2 Jul 2025 16:04:53 +0200 Subject: [PATCH 4/9] refactor: simplify the groups capture --- .github/updatecli.d/bump-go-version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/updatecli.d/bump-go-version.sh b/.github/updatecli.d/bump-go-version.sh index db01f787..01abac89 100755 --- a/.github/updatecli.d/bump-go-version.sh +++ b/.github/updatecli.d/bump-go-version.sh @@ -22,8 +22,8 @@ else fi # Process the GO_RELEASE_VERSION to extract major, minor, patch and security versions -MAJOR_MINOR_PATCH_VERSION=$(echo "$GO_RELEASE_VERSION" | sed -E -e "s#([0-9]+\.[0-9]+\.[0-9]+).*#\1#g") -SECURITY_VERSION=$(echo "$GO_RELEASE_VERSION" | sed -E -e "s#([0-9]+\.[0-9]+\.[0-9]+)(.+)#\2#g") +MAJOR_MINOR_PATCH_VERSION=${GO_RELEASE_VERSION%-*} +SECURITY_VERSION="-${GO_RELEASE_VERSION##*-}" # Gather golang/go sha256 values GOLANG_DOWNLOAD_SHA256_ARM=$(curl -s -L https://golang.org/dl/\?mode\=json | jq -r ".[] | select( .version | contains(\"go${GO_RELEASE_VERSION}\")) | .files[] | select (.filename | contains(\"go${GO_RELEASE_VERSION}.linux-arm64.tar.gz\")) | .sha256") From b7c10d3a063957742d8a5385959413267dd0d090 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Fri, 4 Jul 2025 18:13:44 +0200 Subject: [PATCH 5/9] Update .github/updatecli.d/bump-golang.yml --- .github/updatecli.d/bump-golang.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/updatecli.d/bump-golang.yml b/.github/updatecli.d/bump-golang.yml index 8d131530..92c573f9 100644 --- a/.github/updatecli.d/bump-golang.yml +++ b/.github/updatecli.d/bump-golang.yml @@ -56,7 +56,8 @@ sources: pattern: v1\.{{ source "minor" }}\.(\d*)(-\d*)$ golangVersion: - name: Get golang version + # NOTE: FIPS images need the Microsoft version. + name: Get the Microsoft version of Golang, as it comes out a little later dependson: - latestMicrosoftGoVersion kind: shell From ec9a9267384709cd302d2f56a27619d969df1200 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Fri, 4 Jul 2025 18:25:55 +0200 Subject: [PATCH 6/9] avoid auto-merge --- .github/updatecli.d/bump-golang.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/updatecli.d/bump-golang.yml b/.github/updatecli.d/bump-golang.yml index 92c573f9..904bb2c9 100644 --- a/.github/updatecli.d/bump-golang.yml +++ b/.github/updatecli.d/bump-golang.yml @@ -20,7 +20,7 @@ actions: kind: github/pullrequest scmid: githubConfig spec: - automerge: true + automerge: false labels: - automation - dependencies From 833ab226292432c97fdb29f76d3b82fed684af6c Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Jul 2025 15:45:14 +0200 Subject: [PATCH 7/9] use #638 --- .github/updatecli.d/bump-go-version.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/updatecli.d/bump-go-version.sh b/.github/updatecli.d/bump-go-version.sh index 01abac89..8e6b0847 100755 --- a/.github/updatecli.d/bump-go-version.sh +++ b/.github/updatecli.d/bump-go-version.sh @@ -45,8 +45,6 @@ if [ -z "$GOLANG_DOWNLOAD_SHA256_AMD" ] ; then GOLANG_DOWNLOAD_SHA256_AMD=$(curl -s -L https://golang.org/dl | grep "go${MAJOR_MINOR_PATCH_VERSION}.linux-amd64.tar.gz" -A 5 | grep "" | sed 's#.*##g' | sed 's# Date: Mon, 7 Jul 2025 15:46:10 +0200 Subject: [PATCH 8/9] fix --- .github/updatecli.d/bump-golang.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/updatecli.d/bump-golang.yml b/.github/updatecli.d/bump-golang.yml index 904bb2c9..4757ad31 100644 --- a/.github/updatecli.d/bump-golang.yml +++ b/.github/updatecli.d/bump-golang.yml @@ -93,8 +93,8 @@ conditions: disablesourceinput: true kind: shell spec: - command: grep 'VERSION := {{ source `golangVersion` }}' go/Makefile.common && exit 1 || exit 0 - failwhen: false + command: grep ':= {{ source `golangVersion` }}' go/Makefile.common && exit 1 || exit 0 + failwhen: true targets: update-go-version: From fad7fd5ba7bdb31459decf17855ec7eb21200c98 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Jul 2025 15:58:19 +0200 Subject: [PATCH 9/9] use former approach --- .github/updatecli.d/bump-golang.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/updatecli.d/bump-golang.yml b/.github/updatecli.d/bump-golang.yml index 4757ad31..9f65ec62 100644 --- a/.github/updatecli.d/bump-golang.yml +++ b/.github/updatecli.d/bump-golang.yml @@ -76,24 +76,14 @@ conditions: image: golang tag: '{{ source "golangVersion" }}' sourceid: golangVersion -## As long as there is a bug see https://github.com/updatecli/updatecli/issues/1849 -## Let's use the shell kind rather than the file kind. -## When fixed then uncomment the code and remove is-already-updated -# is: -# name: Is version '{{ source "golangVersion" }}' not updated in 'go/Makefile.common'? -# disablesourceinput: true -# kind: file -# spec: -# file: go/Makefile.common -# line: 5 -# content: VERSION := {{ source `golangVersion` }} -# failwhen: true - is-already-updated: + is: name: Is version '{{ source "golangVersion" }}' not updated in 'go/Makefile.common'? disablesourceinput: true - kind: shell + kind: file spec: - command: grep ':= {{ source `golangVersion` }}' go/Makefile.common && exit 1 || exit 0 + file: go/Makefile.common + line: 5 + content: VERSION := {{ source `golangVersion` }} failwhen: true targets: