Skip to content

Commit 0570e5c

Browse files
Short-circuit API checking script
1 parent f3184f4 commit 0570e5c

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

scripts/check-for-breaking-api-changes.sh

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,4 @@
1313
##
1414
##===----------------------------------------------------------------------===##
1515

16-
set -euo pipefail
17-
18-
log() { printf -- "** %s\n" "$*" >&2; }
19-
error() { printf -- "** ERROR: %s\n" "$*" >&2; }
20-
fatal() { error "$@"; exit 1; }
21-
22-
CURRENT_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
23-
REPO_ROOT="$(git -C "${CURRENT_SCRIPT_DIR}" rev-parse --show-toplevel)"
24-
25-
log "Checking required environment variables..."
26-
test -n "${BASELINE_REPO_URL:-}" || fatal "BASELINE_REPO_URL unset"
27-
test -n "${BASELINE_TREEISH:-}" || fatal "BASELINE_TREEISH unset"
28-
29-
log "Fetching baseline: ${BASELINE_REPO_URL}#${BASELINE_TREEISH}..."
30-
git -C "${REPO_ROOT}" fetch "${BASELINE_REPO_URL}" "${BASELINE_TREEISH}"
31-
BASELINE_COMMIT=$(git -C "${REPO_ROOT}" rev-parse FETCH_HEAD)
32-
33-
log "Checking for API changes since ${BASELINE_REPO_URL}#${BASELINE_TREEISH} (${BASELINE_COMMIT})..."
34-
swift package --package-path "${REPO_ROOT}" diagnose-api-breaking-changes \
35-
"${BASELINE_COMMIT}" \
36-
&& RC=$? || RC=$?
37-
38-
if [ "${RC}" -ne 0 ]; then
39-
fatal "❌ Breaking API changes detected."
40-
exit "${RC}"
41-
fi
42-
log "✅ No breaking API changes detected."
16+
exit 0

0 commit comments

Comments
 (0)