Skip to content

Commit 03bdfa7

Browse files
committed
Reduce likelihood of spurious merge conflict bot comment
Previously, the "Manage PRs" workflow made a comment suggesting to resolve the merge conflict after any failure to merge a pull request. This comment is worded in a way that makes it somewhat applicable to other causes, but still might cause the submitter to waste time unnecessarily trying to figure out how to merge a nonexistent merge conflict when the failure had a different cause. The 405 response is not specific to a failure due to merge conflict, but I believe that all failures due to merge conflict will result in a 405. This means that the check is not perfect, but will make spurious mentions of merge conflict resolution less likely at least. A review is requested from a maintainer any time the merge fails, so they will be able to investigate and provide assistance if necessary.
1 parent 2636446 commit 03bdfa7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/manage-prs.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ jobs:
408408
runs-on: ubuntu-latest
409409
outputs:
410410
pass: ${{ steps.merge.outcome == 'success' }}
411+
status: ${{ steps.merge.outputs.status }}
411412

412413
steps:
413414
- name: Approve pull request
@@ -482,7 +483,8 @@ jobs:
482483
if: needs.merge.outputs.pass == 'false'
483484
runs-on: ubuntu-latest
484485
steps:
485-
- name: Comment on merge failure
486+
- name: Comment on merge conflict
487+
if: needs.merge.outputs.status == '405'
486488
uses: octokit/[email protected]
487489
env:
488490
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -500,6 +502,10 @@ jobs:
500502
501503
Once that is done, it will be merged automatically.
502504
505+
- name: Fail on unidentified merge failure
506+
if: needs.merge.outputs.status != '405'
507+
run: exit 1 # Trigger the `unexpected-fail` job
508+
503509
not-submission:
504510
needs:
505511
- parse

0 commit comments

Comments
 (0)