Skip to content

Commit 27c60c5

Browse files
henrymercerCopilot
andcommitted
Fix detection of merge conflicts outside lib in the rebuild workflow
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent c535168 commit 27c60c5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎.github/workflows/rebuild.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ jobs:
7070
if [ "$MERGE_RESULT" -ne 0 ]; then
7171
echo "merge-in-progress=true" >> $GITHUB_OUTPUT
7272
73-
# Check for merge conflicts outside of `lib`. Disable git diff's trailing whitespace check
74-
# since `node_modules/@types/semver/README.md` fails it.
75-
if git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/'; then
73+
# Check for merge conflicts outside of `lib`.
74+
CONFLICTS_OUTSIDE_LIB=$(git diff --name-only --diff-filter=U | grep --invert-match '^lib/' || true)
75+
if [ -n "$CONFLICTS_OUTSIDE_LIB" ]; then
7676
echo "Merge conflicts were detected outside of the lib directory. Please resolve them manually."
77-
git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/' || true
77+
echo "$CONFLICTS_OUTSIDE_LIB"
7878
exit 1
7979
fi
8080

0 commit comments

Comments
 (0)