Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto-merge approval for Dependabot PRs #183

Open
atc0005 opened this issue Mar 11, 2024 · 0 comments
Open

Add auto-merge approval for Dependabot PRs #183

atc0005 opened this issue Mar 11, 2024 · 0 comments
Assignees
Labels
CI dependencies enhancement New feature or request

Comments

@atc0005
Copy link
Owner

atc0005 commented Mar 11, 2024

Overview

Example from domainr/whois project:

name: Auto-merge ZoneDB

on: pull_request

permissions:
  contents: write
  pull-requests: write

jobs:
  merge:
    runs-on: ubuntu-22.04
    if: ${{ github.actor == 'dependabot[bot]' }}
    steps:
      - name: Dependabot metadata
        id: metadata
        uses: dependabot/[email protected]
        with:
          github-token: "${{ secrets.GITHUB_TOKEN }}"
      - name: Enable auto-merge for Dependabot PRs
        if: ${{contains(steps.metadata.outputs.dependency-names, 'zonedb') && steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
        run: gh pr merge --auto --merge "$PR_URL"
        env:
          PR_URL: ${{github.event.pull_request.html_url}}
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

I would be interested in auto-merging PRs targeting the development branch for most of the projects that I work with.

References

@atc0005 atc0005 added enhancement New feature or request dependencies CI labels Mar 11, 2024
@atc0005 atc0005 self-assigned this Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI dependencies enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant