From 03bdfa79742652751c892ae0832465a0a11debdf Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 29 Jul 2021 20:10:56 -0700 Subject: [PATCH] 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. --- .github/workflows/manage-prs.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manage-prs.yml b/.github/workflows/manage-prs.yml index a2101f37..cacbd46f 100644 --- a/.github/workflows/manage-prs.yml +++ b/.github/workflows/manage-prs.yml @@ -408,6 +408,7 @@ jobs: runs-on: ubuntu-latest outputs: pass: ${{ steps.merge.outcome == 'success' }} + status: ${{ steps.merge.outputs.status }} steps: - name: Approve pull request @@ -482,7 +483,8 @@ jobs: if: needs.merge.outputs.pass == 'false' runs-on: ubuntu-latest steps: - - name: Comment on merge failure + - name: Comment on merge conflict + if: needs.merge.outputs.status == '405' uses: octokit/request-action@v2.x env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -500,6 +502,10 @@ jobs: Once that is done, it will be merged automatically. + - name: Fail on unidentified merge failure + if: needs.merge.outputs.status != '405' + run: exit 1 # Trigger the `unexpected-fail` job + not-submission: needs: - parse