Skip to content

Commit

Permalink
Teach rebuild Action how to resolve conflicts in lib
Browse files Browse the repository at this point in the history
  • Loading branch information
henrymercer committed Feb 14, 2024
1 parent c6cf6fd commit 729def5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/rebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ jobs:
gh pr edit --repo github/codeql-action "$PR_NUMBER" \
--remove-label "Rebuild"
- name: Merge in changes from base branch
env:
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
run: |
git fetch origin "$BASE_BRANCH"
# Allow merge conflicts in `lib`, since rebuilding should resolve them.
git merge "origin/$BASE_BRANCH" || echo "Merge conflicts detected"
# Check for merge conflicts outside of `lib`. Disable git diff's trailing whitespace check
# since `node_modules/@types/semver/README.md` fails it.
if git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/'; then
echo "Merge conflicts detected outside of lib/ directory. Please resolve them manually."
git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/' || true
exit 1
fi
- name: Compile TypeScript
run: |
npm install
Expand Down

0 comments on commit 729def5

Please sign in to comment.