ahmadnassri / action-dependabot-auto-merge

Automatically merge Dependabot PRs when version comparison is within range
MIT License
342 stars 48 forks source link

Auto-merge when target branch #77

Closed WaKeMaTTa closed 3 years ago

WaKeMaTTa commented 3 years ago

Can I auto merge only Pull Request that target a specific branch?


Use case:

I have staging branch I want all Pull Requests open by dependabot to be auto-merged when the CI (tests) is green.

jotoeri commented 3 years ago

This only runs the action, if the target branch is main ☺️

      - uses: ahmadnassri/action-dependabot-auto-merge@v2
        if: github.ref == 'refs/heads/main' &&
            (github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]')
        with:
          target: minor
          github-token: ${{ secrets.DEPENDABOT_MERGE }}