ahmadnassri / action-dependabot-auto-merge

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

Need support for running on workflow_run: workflow completed #99

Open jfarris587 opened 3 years ago

jfarris587 commented 3 years ago

I have a need for triggering an auto-merge after another workflow is complete, which can be done with workflow_run. However, this isn't a supported Event type, only pull_request, pull_request_target therefore it errors:

Error: action triggered outside of a pull_request

And would like additional support.

Here is yml file for workflow:

name: Dependabot Automerge
on:
  workflow_run:
    workflows: ['CI']
    types:
      - completed

jobs:
  auto-merge:
    runs-on: ubuntu-latest
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    steps:
      - uses: actions/checkout@v2

      - uses: ahmadnassri/action-dependabot-auto-merge@v2
        with:
          target: minor
          github-token: ${{ secrets.token }}