Skip to content

Commit

Permalink
check library commit on correct branch
Browse files Browse the repository at this point in the history
Signed-off-by: tobiasKaminsky <[email protected]>
  • Loading branch information
tobiasKaminsky committed Jan 23, 2025
1 parent a4c48a8 commit 782d59c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/detectWrongSettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
3 changes: 2 additions & 1 deletion scripts/analysis/detectWrongSettings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ snapshotCount=$(./gradlew dependencies | grep SNAPSHOT -c)
betaCount=$(grep "<bool name=\"is_beta\">true</bool>" 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!"
Expand Down

0 comments on commit 782d59c

Please sign in to comment.