Skip to content

Commit

Permalink
ci: trigger auto-merge on pr open only
Browse files Browse the repository at this point in the history
to avoid re-enabling a manually disabled auto-merge

removes fetch-metadata because it doesn't work as advertised
see dependabot/fetch-metadata#568
  • Loading branch information
tekumara committed Nov 9, 2024
1 parent 8c9cab1 commit ab48d05
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Dependabot Auto-merge
on: pull_request
on:
pull_request:
types: [opened]

permissions:
contents: write
Expand All @@ -10,14 +12,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'tekumara/fakesnow'
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2
- name: Enable auto-merge for Dependabot PRs
# outputs will only be populated if the target Pull Request was opened by Dependabot
# and contains only Dependabot-created commits, this avoids re-enabling auto-merge
# when its been manually disabled and there are non-dependabot commits on the PR
if: ${{steps.dependabot-metadata.outputs}}
# don't include verbose dependabot PR description as body when merging
run: gh pr merge --auto --squash "$PR_URL" --body ""
env:
Expand Down

0 comments on commit ab48d05

Please sign in to comment.