summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2022-12-04 20:36:11 +0100
committerChristian Marangi <ansuelsmth@gmail.com>2022-12-04 21:13:47 +0100
commit8df40b136a172db2d65745695a60515395339413 (patch)
treea4b46add4e5ff57197ffe4f96203858f807a2177
parentd48f38c30f7c3d8458d86fec238b5153f78df297 (diff)
downloadopenwrt-8df40b136a172db2d65745695a60515395339413.tar.gz
openwrt-8df40b136a172db2d65745695a60515395339413.tar.bz2
openwrt-8df40b136a172db2d65745695a60515395339413.zip
CI: build: fix matching for openwrt release branch for toolchain parsing
The current match logic doesn't handle test for push events related to stable release (example openwrt-22.03) but only fork with the related prefix (example openwrt-22.03-fixup) Fix wrong matching and while at it also add extra checks to other matching (check if the branch name actually start with the requested prefix) Fixes: e24a1e6f6d7f ("CI: build: add support for external toolchains from stable branch") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> (cherry picked from commit e3cf2b84e5f8708ca17d931ef60746516c8a2fe4)
-rw-r--r--.github/workflows/build.yml14
1 files changed, 8 insertions, 6 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f35a70d8f9..115bf2c654 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -151,16 +151,18 @@ jobs:
TOOLCHAIN_PATH=snapshots
if [ -n "${{ github.base_ref }}" ]; then
- if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then
- major_ver="$(echo ${{ github.base_ref }} | sed 's/openwrt-/v/')"
+ if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then
+ major_ver="$(echo ${{ github.base_ref }} | sed 's/^openwrt-/v/')"
fi
elif [ "${{ github.ref_type }}" = "branch" ]; then
- if echo "${{ github.ref_name }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]-'; then
- major_ver="$(echo ${{ github.ref_name }} | sed 's/openwrt-\([0-9][0-9]\.[0-9][0-9]\)-.*/v\1/')"
+ if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then
+ major_ver="$(echo ${{ github.ref_name }} | sed 's/^openwrt-/v/')"
+ elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then
+ major_ver="$(echo ${{ github.ref_name }} | sed 's/^openwrt-\([0-9][0-9]\.[0-9][0-9]\)-.*/v\1/')"
fi
elif [ "${{ github.ref_type }}" = "tag" ]; then
- if echo "${{ github.ref_name }}" | grep -q -E 'v[0-9][0-9]\.[0-9][0-9]\..+'; then
- major_ver="$(sed 's/\(v[0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')"
+ if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then
+ major_ver="$(echo ${{ github.ref_name }} | sed 's/^\(v[0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')"
fi
fi