From 26479bb9f5c42e3294204c2923a67f3185dd061c Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Wed, 25 Nov 2020 01:31:21 +0000 Subject: [PATCH] Fix CI upload assets tag matching The previous version would search for the last tag by matching the beginning of the tag name. By explicitly searching for the trailing `"` with grep, an exact tag match is now enforced. Since releases like v1.2.3 always match the beginning of their RCs (v1.2.3-rc4), this makes sure that the assets aren't pushed to the previous release. --- .github/workflows/upload_asset.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload_asset.sh b/.github/workflows/upload_asset.sh index 3005e707..55845ae9 100755 --- a/.github/workflows/upload_asset.sh +++ b/.github/workflows/upload_asset.sh @@ -35,7 +35,7 @@ upload_url=$(\ 2> /dev/null \ | grep -E "(upload_url|tag_name)" \ | paste - - \ - | grep -e "tag_name\": \"$tag" \ + | grep -e "tag_name\": \"$tag\"" \ | head -n 1 \ | sed 's/.*\(https.*assets\).*/\1/' \ )