I want to build a GitHub Action that triggers on Pull Request (PR) Approval, but only when the PR contains modification to a particular path.
Currently, I have the following implementation:
on:
pull_request_review:
types: [submitted]
paths: ['mypath/**']
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: job name
if: github.event.review.state == 'approved'
[Reference: https://github.community/t/github-actions-manual-trigger-approvals]
However, the build job triggers on Approval, and seems to ignore the path. The build runs on any Approval regardless of what files have been modified in the PR.
Is it possible to trigger a GitHub Action only when a PR modifies a particular path and it is approved?