diff options
-rwxr-xr-x | scripts/clang-format-diff.sh | 15 | ||||
-rwxr-xr-x | scripts/clang-tidy-diff.sh | 4 |
2 files changed, 8 insertions, 11 deletions
diff --git a/scripts/clang-format-diff.sh b/scripts/clang-format-diff.sh index c1f1885b7..01a813f2b 100755 --- a/scripts/clang-format-diff.sh +++ b/scripts/clang-format-diff.sh @@ -3,17 +3,12 @@ set -o errexit set -o pipefail -# When we are running on travis and *not* part of a pull request we don't -# have any upstream branch to compare against. -if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then - echo "Skipping since not running on travis PR" - exit 0 -fi - -if [ -n "$TRAVIS_BRANCH" ]; then - BRANCH=$TRAVIS_BRANCH +if [ -n "$1" ]; then + BRANCH="$1" +elif [ -n "$GITHUB_BASE_REF" ]; then + BRANCH="origin/$GITHUB_BASE_REF" else - BRANCH=origin/main + BRANCH="@{upstream}" fi MERGE_BASE=$(git merge-base $BRANCH HEAD) diff --git a/scripts/clang-tidy-diff.sh b/scripts/clang-tidy-diff.sh index 230764abe..9afe1824e 100755 --- a/scripts/clang-tidy-diff.sh +++ b/scripts/clang-tidy-diff.sh @@ -3,7 +3,9 @@ set -o errexit set -o pipefail -if [ -n "$GITHUB_BASE_REF" ]; then +if [ -n "$1" ]; then + BRANCH="$1" +elif [ -n "$GITHUB_BASE_REF" ]; then BRANCH="origin/$GITHUB_BASE_REF" else BRANCH="@{upstream}" |