-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a PR check to check for conflict markers
This check is primarily intended to validate that any merge conflicts in the v2 -> v1 backport PR are fixed before the PR is merged.
- Loading branch information
1 parent
b3bf557
commit 30b3365
Showing
1 changed file
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Checks for any conflict markers created by git. This check is primarily intended to validate that | ||
# any merge conflicts in the v2 -> v1 backport PR are fixed before the PR is merged. | ||
name: Check for conflicts | ||
|
||
on: | ||
pull_request: | ||
branches: [main, v1, v2] | ||
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened | ||
# by other workflows. | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
# For testing | ||
push: | ||
|
||
jobs: | ||
check-for-conflicts: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Check for conflicts | ||
run: | | ||
FILES_WITH_CONFLICTS=$(grep --extended-regexp --ignore-case --line-number --recursive \ | ||
'^(<<<<<<<|>>>>>>>)' .) | ||
if [[ "${FILES_WITH_CONFLICTS}" ]]; then | ||
echo "Fail: Found merge conflict markers in the following files:" | ||
echo "" | ||
echo "${FILES_WITH_CONFLICTS}" | ||
exit 1 | ||
else | ||
echo "Success: Found no merge conflict markers." | ||
fi |