From 71f4eafa5dabcd1782b9357be82af3c91277a203 Mon Sep 17 00:00:00 2001 From: Sam Burns Date: Sat, 26 Feb 2022 19:41:07 +0000 Subject: [PATCH] To fix the check_api_change.sh build check, change branch name to reflect current default branch of repo --- internal/check_api_change.sh | 6 +++--- internal/runtests.sh | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/internal/check_api_change.sh b/internal/check_api_change.sh index ad2f00c4..40c55b4d 100755 --- a/internal/check_api_change.sh +++ b/internal/check_api_change.sh @@ -25,7 +25,7 @@ set -euo pipefail -UPSTREAM_BRANCH="${GITHUB_BASE_REF:-master}" +UPSTREAM_BRANCH="${GITHUB_BASE_REF:-main}" echo "Checking for incompatible API changes relative to ${UPSTREAM_BRANCH}..." MASTER_CLONE_DIR="$(mktemp -d)" @@ -58,7 +58,7 @@ for pkg in $PKGS; do continue; fi - # Compute export data for master@HEAD. + # Compute export data for main@HEAD. (cd "$MASTER_CLONE_DIR"; apidiff -w "$PKGINFO_MASTER" "$pkg") # Print all changes for posterity. @@ -79,7 +79,7 @@ fi echo "Found breaking API change(s) in: ${incompatible_change_pkgs[*]}." # Found incompatible changes; see if they were declared as OK via a commit. -if git cherry -v master | grep -q "BREAKING_CHANGE_OK"; then +if git cherry -v main | grep -q "BREAKING_CHANGE_OK"; then echo "Allowing them due to a commit message with BREAKING_CHANGE_OK."; exit 0; fi diff --git a/internal/runtests.sh b/internal/runtests.sh index dd564732..9d0584a0 100755 --- a/internal/runtests.sh +++ b/internal/runtests.sh @@ -71,10 +71,9 @@ echo "Ensuring that there are no dependencies not listed in ./internal/alldeps.. # For pull requests, check if there are undeclared incompatible API changes. # Skip this if we're already going to fail since it is expensive. -# CURRENTLY BROKEN -# if [[ ${result} -eq 0 ]] && [[ ! -z "${GITHUB_HEAD_REF:-x}" ]]; then - # echo - # ./internal/check_api_change.sh || result=1; -# fi +if [[ ${result} -eq 0 ]] && [[ ! -z "${GITHUB_HEAD_REF:-x}" ]]; then + echo + ./internal/check_api_change.sh || result=1; +fi exit $result