mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-15 08:56:58 +02:00
.github: Simplify kernel patch script
No point in setting UPDATE_NEEDED to zero if we exit the script without doing anything with the just set variable. Also to avoid mismatches in branch names, export the branch name as a github workflow step output, so the follow-up steps can pick it up and use.
This commit is contained in:
parent
b15055684e
commit
053fe006d3
@ -4,14 +4,13 @@ set -euo pipefail
|
|||||||
|
|
||||||
# trim the 3rd part in the input semver, e.g. from 5.4.1 to 5.4
|
# trim the 3rd part in the input semver, e.g. from 5.4.1 to 5.4
|
||||||
VERSION_SHORT=${VERSION_NEW%.*}
|
VERSION_SHORT=${VERSION_NEW%.*}
|
||||||
UPDATE_NEEDED=1
|
BRANCH_NAME="linux-${VERSION_NEW}-${TARGET}"
|
||||||
|
|
||||||
. .github/workflows/common.sh
|
. .github/workflows/common.sh
|
||||||
|
|
||||||
prepare_git_repo
|
prepare_git_repo
|
||||||
|
|
||||||
if ! checkout_branches "linux-${VERSION_NEW}-${TARGET}"; then
|
if ! checkout_branches "${BRANCH_NAME}"; then
|
||||||
UPDATE_NEEDED=0
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -23,7 +22,6 @@ if [[ -z "${VERSION_OLD}" ]]; then
|
|||||||
fi
|
fi
|
||||||
if [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]]; then
|
if [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]]; then
|
||||||
echo "already the latest Kernel, nothing to do"
|
echo "already the latest Kernel, nothing to do"
|
||||||
UPDATE_NEEDED=0
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -77,5 +75,6 @@ generate_patches sys-kernel coreos-sources Kernel
|
|||||||
|
|
||||||
apply_patches
|
apply_patches
|
||||||
|
|
||||||
echo ::set-output name=VERSION_OLD::"${VERSION_OLD}"
|
echo "VERSION_OLD=${VERSION_OLD}" >>"${GITHUB_OUTPUT}"
|
||||||
echo ::set-output name=UPDATE_NEEDED::"${UPDATE_NEEDED}"
|
echo "UPDATE_NEEDED=1" >>"${GITHUB_OUTPUT}"
|
||||||
|
echo "BRANCH_NAME=${BRANCH_NAME}" >>"${GITHUB_OUTPUT}"
|
||||||
|
@ -53,7 +53,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
base: ${{ steps.figure-out-branch.outputs.BRANCH }}
|
base: ${{ steps.figure-out-branch.outputs.BRANCH }}
|
||||||
branch: linux-${{ steps.fetch-latest-release.outputs.KERNEL_VERSION }}-${{ steps.figure-out-branch.outputs.BRANCH }}
|
branch: ${{ steps.apply-patch.outputs.BRANCH_NAME }}
|
||||||
author: Flatcar Buildbot <buildbot@flatcar-linux.org>
|
author: Flatcar Buildbot <buildbot@flatcar-linux.org>
|
||||||
committer: Flatcar Buildbot <buildbot@flatcar-linux.org>
|
committer: Flatcar Buildbot <buildbot@flatcar-linux.org>
|
||||||
title: Upgrade Linux Kernel for ${{ steps.figure-out-branch.outputs.BRANCH }} from ${{ steps.apply-patch.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.KERNEL_VERSION }}
|
title: Upgrade Linux Kernel for ${{ steps.figure-out-branch.outputs.BRANCH }} from ${{ steps.apply-patch.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.KERNEL_VERSION }}
|
||||||
|
Loading…
Reference in New Issue
Block a user