split up delete old commit to always delete them
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
3102c23d2c
commit
98d1b5e2b9
@ -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#\./##) \;
|
||||
|
Loading…
x
Reference in New Issue
Block a user