Skip to content

Commit

Permalink
update-go-version: Add single quote style for go version update
Browse files Browse the repository at this point in the history
With this PR now `update-go-version.sh` would use single quote around
the version which is not the case with yq 4.21.1 and newer.
`yq eval --inplace ".jobs.build.strategy.matrix.go[0] = 1.21` replaces go: '1.20' with go: 1.21 without quotes

- https://mikefarah.gitbook.io/yq/operators/style
  • Loading branch information
praveenkumar committed May 7, 2024
1 parent b49d820 commit 0831c96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion update-go-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ sed -i "s,^\(FROM registry.ci.openshift.org/openshift/release:rhel-8-release-gol
sed -i "s,^FROM registry.access.redhat.com/ubi8/go-toolset:[.0-9]\+,FROM registry.access.redhat.com/ubi8/go-toolset:${golang_base_version}," images/*/Dockerfile
for f in .github/workflows/*.yml; do
if [ $(yq eval '.jobs.build.strategy.matrix | has("go")' "$f") == "true" ]; then
yq eval --inplace ".jobs.build.strategy.matrix.go[0] = ${golang_base_version}" "$f";
yq eval --inplace ".jobs.build.strategy.matrix.go[0] = ${golang_base_version} | .jobs.build.strategy.matrix.go[0] style=\"single\"" "$f";
fi
done

0 comments on commit 0831c96

Please sign in to comment.