Drone Upload: Fix if condition for master, in addition to #2213
authorMichael Schuster <michael@schuster.ms>
Mon, 20 Jul 2020 23:20:19 +0000 (01:20 +0200)
committerMichael Schuster <michael@schuster.ms>
Mon, 20 Jul 2020 23:20:19 +0000 (01:20 +0200)
Don't try to comment on master (old condition was from a previous version of the script).

Signed-off-by: Michael Schuster <michael@schuster.ms>
admin/linux/upload-appimage.sh

index d237141089f7baa96786bc889cedc798c19411de..e008b36a83abbe0844df89d590f953288025ca31 100755 (executable)
@@ -34,7 +34,7 @@ echo "Found AppImage: $BASENAME"
 
 apt-get -y install jq
 
-if [[ "$TAG_NAME" != *.master ]]; then
+if [ $TAG_NAME != "master" ]; then
     # Delete all old comments in desktop PR, starting with "AppImage file:"
     oldComments=$(curl 2>/dev/null -u $GIT_USERNAME:$GIT_TOKEN -X GET $DESKTOP_API_BASE_URL/issues/$PR/comments | jq '.[] | (.id |tostring) + "|" + (.user.login | test("'${GIT_USERNAME}'") | tostring) + "|" + (.body | test("AppImage file:.*") | tostring)'  | grep "true|true" | tr -d "\"" | cut -f1 -d"|")
 
@@ -128,7 +128,7 @@ if [[ "$browserDownloadUrl" == "null" ]]; then
     exit 3
 fi
 
-if [[ "$TAG_NAME" != *.master ]]; then
+if [ $TAG_NAME != "master" ]; then
     # Create comment in desktop PR
     curl 2>/dev/null -u $GIT_USERNAME:$GIT_TOKEN -X POST $DESKTOP_API_BASE_URL/issues/$PR/comments -d "{ \"body\" : \"AppImage file: [$BASENAME]($browserDownloadUrl) <br/><br/>To test this change/fix you can simply download above AppImage file and test it. <br/><br/>Please make sure to quit your existing Nextcloud app and backup your data. \" }"
 fi