checkIfRunDrone.sh 664 B

123456789101112131415161718192021
  1. #!/bin/sh -e
  2. # SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
  3. # SPDX-FileCopyrightText: 2019-2022 Tobias Kaminsky <tobias@kaminsky.me>
  4. # SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
  5. PR_NUMBER=$1
  6. if [ -z "$PR_NUMBER" ] ; then
  7. echo "Merge commit to master -> continue with CI"
  8. exit 0
  9. fi
  10. export BRANCH=$(scripts/analysis/getBranchBase.sh "$PR_NUMBER" | sed 's/"//g')
  11. if [ "$(git diff --name-only "origin/$BRANCH" | grep -cE "^app/src|screenshots|build.gradle|.drone.yml|gradle")" -eq 0 ] ; then
  12. echo "No source files changed"
  13. exit 1
  14. else
  15. echo "Source files changed -> continue with CI"
  16. exit 0
  17. fi