|
@@ -2,14 +2,20 @@
|
|
|
|
|
|
deleteOldComments() {
|
|
|
# delete all old comments, matching this type
|
|
|
+ echo "Deleting old comments for $BRANCH_TYPE"
|
|
|
oldComments=$(curl 2>/dev/null -u $GITHUB_USER:$GITHUB_PASSWORD -X GET https://api.github.com/repos/nextcloud/android/issues/$PR/comments | jq --arg TYPE $BRANCH_TYPE '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) + "|" + (.body | test([$TYPE]) | tostring)'| grep "true|true" | tr -d "\"" | cut -f1 -d"|")
|
|
|
+ count=$(echo $oldComments | grep true | wc -l)
|
|
|
+ echo "Found $count old comments"
|
|
|
|
|
|
echo $oldComments | while read comment ; do
|
|
|
+ echo "Deleting comment: $comment"
|
|
|
curl 2>/dev/null -u $GITHUB_USER:$GITHUB_PASSWORD -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
|
|
|
done
|
|
|
}
|
|
|
|
|
|
upload() {
|
|
|
+ deleteOldComments
|
|
|
+
|
|
|
cd $1
|
|
|
|
|
|
find . -type d -exec curl -u $USER:$PASS -X MKCOL $URL/$REMOTE_FOLDER/$(echo {} | sed s#\./##) \;
|