summaryrefslogtreecommitdiff
path: root/.github/workflows/autobot.yaml
blob: 9dc8df333bdccf107885e5f626f86ef725d9f621 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
name: auto-merge dependabot

on: pull_request

permissions:
  contents: write
  pull-requests: write

jobs:
  automerge:
    runs-on: ubuntu-latest
    if: github.actor == 'dependabot[bot]'
    steps:
      - uses: dependabot/fetch-metadata@v1
        id: metadata
        with:
          github-token: ${{ github.token }}

      - name: enable auto-merge
        if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
        run: gh pr merge --auto --rebase "$PR"
        env:
          PR: ${{ github.event.pull_request.html_url }}
          GITHUB_TOKEN: ${{ secrets.MERGE_TOKEN }}