From 0a93596e4a6ddbc9ba4b9674f52226994762691a Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Tue, 12 Jan 2021 11:06:27 +0100 Subject: [PATCH] .github: pass env variables explicitly as string Since Kernel 5.10, Github Actions simply stopped working. What happens is that `KV_MAIN` gets passed as environmental variable to the inline script, but not as string but float, because it contains `.`. Apparently the last digit of the misinterpreted float number is afterwards simply dropped by YAML parsing library used by GA. As a result, `KV_MAIN` becomes `5.1` instead of `5.10`, `versionMain` becomes simply `5.10`, not `5.10.6`. Then in the next steps, both `VERSION_NEW` and `VERSION_OLD` become `5.10`, and the script thinks it is already the latest version, so simply does not create a new pull request. It was not an issue when Kernel version is <= 5.9, because no digit got dropped from the variable. Now the hidden issue was uncovered. Simply set `KV_MAIN` or others explicitly as strings, by adding quotes, to avoid such issues. --- .../coreos-overlay/.github/workflows/go-releases-main.yml | 2 +- .../coreos-overlay/.github/workflows/kernel-releases-main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-main.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-main.yml index bc4da2ba6c..b4e6ff6f05 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-main.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-main.yml @@ -13,7 +13,7 @@ jobs: - name: Fetch latest Go release id: fetch-latest-release env: - GO_VERSION: 1.15 + GO_VERSION: "1.15" run: | git clone --depth=1 --no-checkout https://github.com/golang/go versionMain=$(git -C go ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/go${GO_VERSION}.[0-9]*$/s/^refs\/tags\/go//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -1) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml index a002bd48f0..fb2f46167a 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml @@ -13,7 +13,7 @@ jobs: - name: Fetch latest Kernel release id: fetch-latest-release env: - KV_MAIN: 5.10 + KV_MAIN: "5.10" run: | git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux versionMain=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_MAIN}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1)