mirror of
https://github.com/flatcar/scripts.git
synced 2025-10-03 19:42:15 +02:00
.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.
This commit is contained in:
parent
58579a67e4
commit
0a93596e4a
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user