Skip to content

Commit f2697b6

Browse files
committed
GH Actions: add merge-conflict check
This commit adds a new workflow which runs on pushes (merges) to any of the long-running branches and whenever the contents of a pull requests changes. It will check whether any open PRs are in a "conflict state" (after the push) and if so, will add a "merge conflict" label and leave a comment on the PR asking the OP to solve the conflict. The workflow will automatically remove the label again when the conflict is resolved. This workflow uses a reusable action stored in the `.github` repository which takes care of the default settings, though a number of settings can still be overruled for an individual repo. For now, it has not been deemed necessary to overrule these though.
1 parent 73a7040 commit f2697b6

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Check PRs for merge conflicts
2+
3+
on:
4+
# Check for new conflicts due to merges.
5+
push:
6+
branches:
7+
- main
8+
- trunk
9+
- 'release/**'
10+
- 'hotfix/[0-9]+.[0-9]+*'
11+
- 'feature/**'
12+
# Check conflicts in new PRs and for resolved conflicts due to an open PR being updated.
13+
pull_request_target:
14+
types:
15+
- opened
16+
- synchronize
17+
- reopened
18+
19+
jobs:
20+
check-prs:
21+
if: github.repository_owner == 'Yoast'
22+
23+
name: Check PRs for merge conflicts
24+
uses: Yoast/.github/.github/workflows/reusable-merge-conflict-check.yml@main

0 commit comments

Comments
 (0)