Skip to content

Commit

Permalink
ci(dependabot): enable auto-merge for upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgb committed Jan 18, 2025
1 parent f952eaf commit 66d9c44
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/dependabot-automerge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Dependabot auto-merge

on:
pull_request:
branches:
- 'main'

permissions:
contents: read # for actions/checkout to fetch code

jobs:
dependabot:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'weaveworks/weave-gitops'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@dbb049abf0d677abbd7f7eee0375145b417fdd34 # v2.2.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: steps.metadata.outputs.update-type == 'version-update:semver-minor'
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: gh pr merge --auto --rebase "$PR_URL"

0 comments on commit 66d9c44

Please sign in to comment.