Ver Fonte

Check library check only when base branch is master

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky há 6 anos atrás
pai
commit
53b52297d5

+ 3 - 2
scripts/analysis/analysis-wrapper.sh

@@ -49,8 +49,9 @@ else
         curl 2>/dev/null -u $1:$2 -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
     done
     
-    # check library
-    if [ $(grep "android-library:master" build.gradle -c) -ne 3 ]; then
+    # check library, only if base branch is master
+    baseBranch=$(scripts/analysis/getBranchBase.sh $1 $2 $7 | tr -d "\"")
+    if [ $baseBranch = "master" -a $(grep "android-library:master" build.gradle -c) -ne 3 ]; then
         checkLibraryMessage="<h1>Android-library is not set to master branch in build.gradle</h1>"
         checkLibrary=1
     else 

+ 9 - 0
scripts/analysis/getBranchBase.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# $1: username, $2: password/token, $3: pull request number
+
+if [ -z $3 ] ; then
+    echo "master";
+else
+    curl 2>/dev/null -u $1:$2 https://api.github.com/repos/nextcloud/android/pulls/$3 | jq .base.ref
+fi