Эх сурвалжийг харах

delete old comments

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 6 жил өмнө
parent
commit
1198154f0b

+ 3 - 3
.drone.yml

@@ -1,6 +1,6 @@
 pipeline:
   compile:
-    image: nextcloudci/android:android-35
+    image: nextcloudci/android:android-36
     commands:
       # uncomment gplay for Gplay
       - sh -c "if [ '${FLAVOR}' = 'Gplay' ]; then sed -i '/.*com.google.*/s/^.*\\/\\///g' build.gradle; fi"
@@ -11,7 +11,7 @@ pipeline:
         FLAVOR: [Generic, Gplay]
 
   test:
-    image: nextcloudci/android:android-35
+    image: nextcloudci/android:android-36
     privileged: true
     commands:
       - emulator -avd android-27 -no-window -no-audio &
@@ -28,7 +28,7 @@ pipeline:
         FLAVOR: Gplay
 
   analysis:
-    image: nextcloudci/android:android-35
+    image: nextcloudci/android:android-36
     commands:
       # needs gplay
       - sed -i '/.*com.google.*/s/^.*\\/\\///g' build.gradle

+ 7 - 0
scripts/analysis/analysis-wrapper.sh

@@ -42,6 +42,13 @@ else
     echo "New findbugs results at https://nextcloud.kaminsky.me/index.php/s/fYZa7NeBsnmFZQD ->" $6.html
     curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/findbugs/$6.html --upload-file build/reports/findbugs/findbugs.html
     
+    # delete all old comments
+    oldComments=$(curl -u $1:$2 -X GET https://api.github.com/repos/nextcloud/android/issues/$7/comments | jq '.[] | (.id |tostring)  + "|" + (.user.login | test("nextcloud-android-bot") | tostring) ' | grep true | tr -d "\"" | cut -f1 -d"|")
+    
+    echo $oldComments | while read comment ; do 
+        curl -u $1:$2 -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
+    done
+    
     # add comment with results
     lintResult="<h1>Lint</h1><table width='500' cellpadding='5' cellspacing='2'><tr class='tablerow0'><td>"$(tail -n1 scripts/analysis/lint-results.txt | cut -f2 -d':' |cut -f1 -d'<')"</td></tr></table>"
     findbugsResultNew=$(sed -n "/<h1>Summary<\/h1>/,/<h1>Warnings<\/h1>/p" build/reports/findbugs/findbugs.html |head -n-1 | sed s'/<\/a>//'g | sed s'/<a.*>//'g | sed s'/Summary/FindBugs (new)/' | tr "\"" "\'" | tr -d "\n")