Skip to content

Fix auto merge

Fix auto merge #3

name: Dependabot Auto-Merge
on:
pull_request:
branches: ["master", "main"]
types: [opened, synchronize, reopened]
# Define permissions at the workflow level
permissions:
pull-requests: write # Needed to merge PRs and comment
contents: write # Needed to update the repository (e.g., merge commits)
jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' # Only trigger for Dependabot PRs
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Auto-merge Dependabot PRs
run: |
gh pr comment "$PR_URL" --body "Auto-merging this Dependabot PR."
gh pr merge "$PR_URL" --auto --merge
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}