Skip to content

Commit

Permalink
[ci] Fix bazel check for changes (#28)
Browse files Browse the repository at this point in the history
* Add tmp echo debug statements

* Simulate changes in test

* try

* quick test

* patch for now

* undo
  • Loading branch information
murki authored Sep 9, 2024
1 parent 224b5e2 commit 80b3c0c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ci/check_bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ set -euo pipefail
# Trap to handle unexpected errors and log them
trap 'echo "An unexpected error occurred during Bazel check."; echo "check_result=1" >> "$GITHUB_OUTPUT"; exit 1' ERR

# Ensure we fetch the base branch (main) to make it available
git fetch origin "$GITHUB_BASE_REF":"$GITHUB_BASE_REF"
# Check if GITHUB_BASE_REF is set (i.e., you're in a pull request)
if [ -n "$GITHUB_BASE_REF" ]; then
git fetch origin "$GITHUB_BASE_REF":"$GITHUB_BASE_REF"
base_sha=$(git rev-parse "$GITHUB_BASE_REF")
else
echo "Not in a pull request, skipping base ref fetch."
base_sha=$(git rev-parse HEAD)
fi

# Get the latest commit SHA for the base branch (target branch of the PR)
base_sha=$(git rev-parse "$GITHUB_BASE_REF")
# Get the latest commit SHA for the PR branch (the head ref in the forked repository)
final_revision=$GITHUB_SHA

Expand Down

0 comments on commit 80b3c0c

Please sign in to comment.