🏡 index : github.com/captn3m0/news.git

name: Dependabot auto-merge release-updates
on: pull_request

# Based on https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request
permissions:
  pull-requests: write
  contents: write

jobs:
  dependabot:
    runs-on: ubuntu-latest
    if: ${{ github.actor == 'dependabot[bot]' }}
    steps:
      - id: metadata
        name: Dependabot metadata
        uses: dependabot/fetch-metadata@v2.4.0
        with:
          github-token: "${{ secrets.GITHUB_TOKEN }}"

      # We automatically merge all submodules and github actions updates.
      # since we use fairly well-trusted actions (owned by github/ruby)
      # and the git-submodule (emoji-every-day) is also trusted.
      - name: Enable auto-merge for Dependabot PRs for release data
        if: ${{steps.dependabot-metadata.outputs.package-ecosystem}}!="bundler"
        run: gh pr merge --auto --rebase "$PR_URL"
        env:
          PR_URL: ${{github.event.pull_request.html_url}}
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}