# Automatically merge non-functional Dependabot updates, which means anything but Castle.Core.
# All dependencies other than Castle.Core are either test frameworks or style/quality libraries.

name: Auto merge
on: pull_request

permissions:
  pull-requests: write
  contents: write

jobs:
  dependabot:
    if: ${{ github.actor == 'dependabot[bot]' }}
    runs-on: ubuntu-latest

    steps:

      - name: Dependabot metadata
        id: metadata
        uses: dependabot/fetch-metadata@v1.1.1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

      - name: Approve PR
        if: ${{ contains(steps.metadata.outputs.dependency-names, 'Castle.Core') == false }}
        run: gh pr review --approve "$PR_URL"
        env:
          PR_URL: ${{github.event.pull_request.html_url}}
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

      - name: Enable auto-merge
        if: ${{ contains(steps.metadata.outputs.dependency-names, 'Castle.Core') == false }}
        run: gh pr merge --auto --merge "$PR_URL"
        env:
          PR_URL: ${{github.event.pull_request.html_url}}
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

# Automatically merge non-functional Dependabot updates, which means anything but Castle.Core.
# All dependencies other than Castle.Core are either test frameworks or style/quality libraries.

name: Auto merge
on: pull_request

permissions:
  pull-requests: write
  contents: write

jobs:
  dependabot:
    if: ${{ github.actor == 'dependabot[bot]' }}
    runs-on: ubuntu-latest

    steps:

      - name: Dependabot metadata
        id: metadata
        uses: dependabot/fetch-metadata@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

      - name: Approve PR
        if: ${{ contains(steps.metadata.outputs.dependency-names, 'Castle.Core') == false }}
        run: gh pr review --approve "$PR_URL"
        env:
          PR_URL: ${{github.event.pull_request.html_url}}
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

      - name: Enable auto-merge
        if: ${{ contains(steps.metadata.outputs.dependency-names, 'Castle.Core') == false }}
        run: gh pr merge --auto --merge "$PR_URL"
        env:
          PR_URL: ${{github.event.pull_request.html_url}}
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Use the v1 Tag for dependabot/fetch-metadata
Use the v1 Tag for dependabot/fetch-metadata
