-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Enzo Desiage
committed
Apr 18, 2023
1 parent
51d5e4f
commit 301eac0
Showing
3 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
BUF="$(readlink "$buf_path")" | ||
CONF="$(readlink "$buf_config")" | ||
REPO_PATH="$(dirname "$(readlink "$WORKSPACE")")" | ||
cd "$REPO_PATH" | ||
|
||
if [[ -n "$(git rev-parse -q --verify MERGE_HEAD)" ]]; then | ||
echo "Currently merging, skipping buf checks" | ||
exit 0 | ||
fi | ||
|
||
if [[ "${CI:-}" == "true" ]]; then | ||
echo "Fetch the master branch" | ||
git fetch origin master:master | ||
fi | ||
|
||
MERGE_BASE="$(git merge-base HEAD master)" | ||
|
||
"$BUF" breaking --against ".git#ref=$MERGE_BASE" --config="$CONF" . |