From 1047dbd91bba61e2b4f74571d05bacd25cb7f7b9 Mon Sep 17 00:00:00 2001 From: Murshed Jamil Ahmed Date: Tue, 16 Jul 2024 11:26:38 -0400 Subject: [PATCH] IOPZ-2665 | Update automerge logic to approve and merge dependabots automatically --- _github/workflows/dependabot-prs.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/_github/workflows/dependabot-prs.yml b/_github/workflows/dependabot-prs.yml index a43af8c..df88e34 100644 --- a/_github/workflows/dependabot-prs.yml +++ b/_github/workflows/dependabot-prs.yml @@ -43,14 +43,7 @@ jobs: # c) our scripts have flagged the PR as an automergeable dependency (i.e # a stable dependency with good unit test coverage) that has passed # the waiting period. - # - # Note that we also do nothing when the PR has already had auto-merge - # enabled, to prevent scenarios where this check runs many times (for - # instance, because removing `Needs QA` triggers another run, or because - # other PRs are merging and causing this to rebase and trigger another - # run) and then approves the PR many times, which is confusing and looks - # awkward. - if: ${{ (github.actor == 'dependabot[bot]' || github.actor == 'panorama-bot-r') && steps.unique-committers.outputs.committers == '["dependabot[bot]"]' && !github.event.pull_request.auto_merge && (contains(github.event.pull_request.labels.*.name, 'development-dependencies') || steps.dependabot-metadata.outputs.dependency-type == 'direct:development' || contains(github.event.pull_request.labels.*.name, 'automerge-dependencies')) }} + if: ${{ (github.actor == 'dependabot[bot]' || github.actor == 'panorama-bot-r') && steps.unique-committers.outputs.committers == '["dependabot[bot]"]' && (contains(github.event.pull_request.labels.*.name, 'development-dependencies') || steps.dependabot-metadata.outputs.dependency-type == 'direct:development' || contains(github.event.pull_request.labels.*.name, 'automerge-dependencies')) }} run: gh pr merge --auto --merge "$PR_URL" && gh pr edit "$PR_URL" --remove-label "Needs QA" && gh pr review --approve "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}}