Skip to content

Commit 3e033f2

Browse files
committed
CI: issue-labeller: also parse release-SNAPSHOT format
Also parse release-SNAPSHOT format as valid release. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
1 parent 0a3f3c9 commit 3e033f2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/issue-labeller.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@ jobs:
6060
RELEASE: ${{ steps.issue-parser.outputs.issueparser_release }}
6161
run: |
6262
# Make sure this is a real release following pattern r[0-9]-[0-9a-z]
63-
[ -z "$(echo "${{ env.RELEASE }}" | grep -Po '^SNAPSHOT$|^[0-9]+\.[0-9]+\.[0-9](-rc[0-9]+)*$')" ] && echo "invalid_release=true" >> "$GITHUB_OUTPUT" && exit 0
63+
[ -z "$(echo "${{ env.RELEASE }}" | grep -Po '^SNAPSHOT$|^[0-9]+\.[0-9]+-SNAPSHOT$|^[0-9]+\.[0-9]+\.[0-9](-rc[0-9]+)*$')" ] && echo "invalid_release=true" >> "$GITHUB_OUTPUT" && exit 0
6464
6565
release=${{ env.RELEASE }}
6666
# With release we need to add v for tag verification
6767
[ -n "$(echo ${{ env.RELEASE }} | grep -Po '^[0-9]+\.[0-9]+\.[0-9](-rc[0-9]+)*$')" ] && release=v${{ env.RELEASE }}
68+
[ -n "$(echo ${{ env.RELEASE }} | grep -Po '^[0-9]+\.[0-9]+-SNAPSHOT$')" ] && release=openwrt-$(echo ${{ env.RELEASE }} | grep -Po '^[0-9]+\.[0-9]+')
6869
6970
# Check if this release exist or is something downstream
70-
[ $release != "SNAPSHOT" ] && ! git show-ref --tags $release --quiet && echo "invalid_release=true" >> "$GITHUB_OUTPUT" && exit 0
71+
[ $release != "SNAPSHOT" ] && [ -z $(echo $release | grep -Po '^openwrt-[0-9]+\.[0-9]+$') ] && ! git show-ref --tags $release --quiet && echo "invalid_release=true" >> "$GITHUB_OUTPUT" && exit 0
7172
7273
tag_name=${{ env.RELEASE }}
7374
[ $tag_name != "SNAPSHOT" ] && tag_name=release/$(echo ${{ env.RELEASE }} | grep -Po '^[0-9]+\.[0-9]+')
@@ -130,7 +131,7 @@ jobs:
130131
DUMP_TARGET_INFO_SCRIPT: scripts/dump-target-info.pl
131132
run: |
132133
BRANCH=${{ env.BRANCH }}
133-
[ $BRANCH != "main" ] && BRANCH=openwrt-$(echo ${{ env.BRANCH }} | sed 's/^v\([0-9]\+\.[0-9]\+\)\.[0-9]\(-rc[0-9]\+\)*$/\1/')
134+
[ $BRANCH != "main" ] && [ -z $( echo $BRANCH | grep -Po '^openwrt-[0-9]+\.[0-9]+$' ) ] && BRANCH=openwrt-$(echo ${{ env.BRANCH }} | sed 's/^v\([0-9]\+\.[0-9]\+\)\.[0-9]\(-rc[0-9]\+\)*$/\1/')
134135
135136
# Checkout upstream version of the DUMP_TARGET_INFO_SCRIPT
136137
git checkout -q origin/$BRANCH ${{ env.DUMP_TARGET_INFO_SCRIPT }}

0 commit comments

Comments
 (0)