Skip to content

Commit

Permalink
fail explicitly if base_ref is empty in PR/MQ (#13910)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel authored Jul 23, 2024
1 parent 518350d commit 2b09956
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/client-compatibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ jobs:
- name: Check for go.mod changes
id: changes
run: |
if [ -z "${{ github.base_ref }}" ]; then
echo "No base branch found, this should not happen in a PR or MQ. Please reach out to the Test Tooling team."
echo "Github even that triggered the workflow: $GITHUB_EVENT_NAME"
echo "Github ref that triggered the workflow: $GITHUB_REF"
exit 1
fi
git fetch origin ${{ github.base_ref }}
# if no match is found then grep exits with code 1, but if there is a match it exits with code 0
# this will return a match if there are any changes on that corresponding line, for example if spacing was changed
Expand Down

0 comments on commit 2b09956

Please sign in to comment.