dorny / paths-filter

Conditionally run actions based on files modified by PR, feature branch or pushed commits
MIT License
1.98k stars 230 forks source link

Allow `pull_request_review` event. #232

Open jcchavezs opened 3 months ago

jcchavezs commented 3 months ago

Hi, thanks for this action, it helps a lot to filter executions. Now I am facing an issue:

Currently when using this action on a pull_request_review event we get

This action can be triggered only by pull_request or push event

however, there are common cases where you only want the job to happen if it gets an approval however that event won't trigger the job because this action only support push and pull_request.

Imagine this workflow:

name: My workflow
on:
  pull_request_review:
    types: [submitted]
jobs:
  terraform-plan:
    runs-on: [layer0-runner]
    if: github.event.review.state == 'approved'
    steps:
    - uses: actions/checkout@v3
    - uses: dorny/paths-filter@v3
       id: changes
      with:
        filters: |
          src:
            - 'src/**'