Skip to content

Commit bd1665f

Browse files
committed
fix: only enable automerge dependencies on on open / reopen
Only enable the automerge when the PR is opened or reopened, but not if e.g. rebased or pushed. This is needed if the PR is known bad and you try to fix it, but in the meantime its automerged, even if you disabled it. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 506aa01 commit bd1665f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

workflow-templates/dependabot-approve-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ jobs:
5353
# Enable GitHub auto merge
5454
- name: Auto merge
5555
uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # v2.0.0
56-
if: startsWith(steps.branchname.outputs.branch, 'dependabot/')
56+
if: startsWith(steps.branchname.outputs.branch, 'dependabot/') && (github.event.pull_request.action == 'opened' || github.event.pull_request.action == 'reopened')
5757
with:
5858
github-token: ${{ secrets.GITHUB_TOKEN }}

workflow-templates/renovate-approve-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ jobs:
5353
# Enable GitHub auto merge
5454
- name: Auto merge
5555
uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # v2.0.0
56-
if: startsWith(steps.branchname.outputs.branch, 'renovate/')
56+
if: startsWith(steps.branchname.outputs.branch, 'renovate/') && (github.event.pull_request.action == 'opened' || github.event.pull_request.action == 'reopened')
5757
with:
5858
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)