diff --git a/.github/workflows/detectWrongSettings.yml b/.github/workflows/detectWrongSettings.yml index 22e9f9f3bd80..7e70c69af73a 100644 --- a/.github/workflows/detectWrongSettings.yml +++ b/.github/workflows/detectWrongSettings.yml @@ -27,4 +27,4 @@ jobs: distribution: "temurin" java-version: 17 - name: Detect SNAPSHOT - run: scripts/analysis/detectWrongSettings.sh + run: scripts/analysis/detectWrongSettings.sh ${{ github.event.number }} diff --git a/scripts/analysis/detectWrongSettings.sh b/scripts/analysis/detectWrongSettings.sh index e52133937a45..0eef36f18602 100755 --- a/scripts/analysis/detectWrongSettings.sh +++ b/scripts/analysis/detectWrongSettings.sh @@ -8,7 +8,8 @@ snapshotCount=$(./gradlew dependencies | grep SNAPSHOT -c) betaCount=$(grep "true" app/src/main/res/values/setup.xml -c) libraryHash=$(grep androidLibraryVersion build.gradle | cut -d= -f2 | tr -d \") -lastHashes=$(curl https://api.github.com/repos/nextcloud/android-library/commits | jq ".[] .sha" | head -n 10) +baseBranch=$(getBranchBase.sh "$1" | sed 's/"//g') +lastHashes=$(curl "https://api.github.com/repos/nextcloud/android-library/commits?sha=$baseBranch") | jq ".[] .sha" | head -n 10) if [[ $(echo "$lastHashes" | grep -c $libraryHash) -ne 1 ]]; then echo "Library commit not within last 10 hashes, please rebase!"