c2c-sync/scripts/checkIfRunDrone.sh

22 lines
668 B
Bash
Raw Normal View History

2025-09-18 17:54:51 +02:00
#!/bin/sh -e
# SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2019-2022 Tobias Kaminsky <tobias@kaminsky.me>
2025-09-18 18:43:03 +02:00
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
2025-09-18 17:54:51 +02:00
PR_NUMBER=$1
if [ -z "$PR_NUMBER" ] ; then
echo "Merge commit to master -> continue with CI"
exit 0
fi
export BRANCH=$(scripts/analysis/getBranchBase.sh "$PR_NUMBER" | sed 's/"//g')
2025-11-20 16:16:40 +01:00
if [ "$(git diff --name-only "origin/$BRANCH" | grep -cE "^app/src|screenshots|build.gradle.kts|.drone.yml|gradle")" -eq 0 ] ; then
2025-09-18 17:54:51 +02:00
echo "No source files changed"
exit 1
else
echo "Source files changed -> continue with CI"
exit 0
fi