Skip to content

Add dependabot auto-merge common workflow #1

Add dependabot auto-merge common workflow

Add dependabot auto-merge common workflow #1

name: Dependabot auto-merge
on:
workflow_call:
secrets:
GITHUB_TOKEN:

Check failure on line 6 in .github/workflows/dependabot-auto-merge.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/dependabot-auto-merge.yml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
required: true
permissions:
contents: write
pull-requests: write
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}