Update New web #37
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
name: Check unresolved merge conflict | |
on: pull_request | |
jobs: | |
merge_conflict_job: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check for merge conflicts | |
run: | | |
# Find files with merge conflict markers | |
conflicted_files=$(git grep --quiet -e "<<<<<<<" -e ">>>>>>>" ":(exclude).github/" && echo "true" || echo "false") | |
# If there are conflicts, print the filenames | |
if [ "$conflicted_files" = "true" ]; then | |
echo "Unresolved merge conflicts found in the following files:" | |
git grep -e "<<<<<<<" -e ">>>>>>>" ":(exclude).github/" | |
exit 1 | |
else | |
echo "No unresolved merge conflicts found." | |
fi |