mirror of https://github.com/nextcloud/android
scripts: Remove deleteOldComments.sh
Only used by screenShotTest.yml, but uploadReports.sh already has a function for the same purpose. Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
f3f14bfcc4
commit
131373f066
|
@ -23,8 +23,6 @@ jobs:
|
|||
mkdir -p $HOME/.gradle
|
||||
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties
|
||||
./gradlew assembleGplayDebug
|
||||
- name: Delete old comments
|
||||
run: scripts/deleteOldComments.sh "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}} ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: run tests
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
#1: LOG_USERNAME
|
||||
#2: LOG_PASSWORD
|
||||
#3: DRONE_BUILD_NUMBER
|
||||
#4: BRANCH (stable or master)
|
||||
#5: TYPE (IT or Unit)
|
||||
#6: DRONE_PULL_REQUEST
|
||||
#7: GITHUB_TOKEN
|
||||
|
||||
BRANCH=$1
|
||||
TYPE=$2
|
||||
PR=$3
|
||||
GITHUB_USER=$4
|
||||
GITHUB_PASSWORD=$5
|
||||
BRANCH_TYPE=$BRANCH-$TYPE
|
||||
|
||||
# delete all old comments, matching this type
|
||||
echo "Deleting old comments for $BRANCH_TYPE"
|
||||
oldComments=$(curl 2>/dev/null --header "authorization: Bearer $GITHUB_TOKEN" -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 --header "authorization: Bearer $GITHUB_TOKEN" -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
|
||||
done
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue