Commits
Tim Donohue authored f782ee921c0
1 1 | # This workflow checks open PRs for merge conflicts and labels them when conflicts are found |
2 2 | name Check for merge conflicts |
3 3 | |
4 4 | # Run whenever the "main" branch is updated |
5 5 | # NOTE: This means merge conflicts are only checked for when a PR is merged to main. |
6 6 | on |
7 7 | push |
8 - | branches |
9 - | main |
8 + | branches main |
9 + | # So that the `conflict_label_name` is removed if conflicts are resolved, |
10 + | # we allow this to run for `pull_request_target` so that github secrets are available. |
11 + | pull_request_target |
12 + | types synchronize |
10 13 | |
11 14 | jobs |
12 15 | triage |
13 16 | runs-on ubuntu-latest |
17 + | permissions |
18 + | issues write |
19 + | pull-requests write |
14 20 | steps |
15 - | # See: https://github.com/mschilde/auto-label-merge-conflicts/ |
21 + | # See: https://github.com/prince-chrismc/label-merge-conflicts-action |
16 22 | name Auto-label PRs with merge conflicts |
17 - | uses mschilde/auto-label-merge-conflicts@v2.0 |
23 + | uses prince-chrismc/label-merge-conflicts-action@v2 |
18 24 | # Add "merge conflict" label if a merge conflict is detected. Remove it when resolved. |
19 25 | # Note, the authentication token is created automatically |
20 26 | # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token |
21 27 | with |
22 - | CONFLICT_LABEL_NAME 'merge conflict' |
23 - | GITHUB_TOKEN $ secrets.GITHUB_TOKEN |
24 - | # Ignore errors |
25 - | continue-on-error true |
28 + | conflict_label_name 'merge conflict' |
29 + | github_token $ secrets.GITHUB_TOKEN |
30 + | conflict_comment |
31 + | Hi @${author}, |
32 + | Conflicts have been detected against the base branch. |
33 + | Please [resolve these conflicts](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/about-merge-conflicts) as soon as you can. Thanks! |