Home > database >  How to trigger workflow action if it touches certain file or is a Pull Request with a certan file
How to trigger workflow action if it touches certain file or is a Pull Request with a certan file

Time:01-28

I have the following action:

name: Run after changing anything in myPath package
on:
  pull_request:
  push:
    paths:
      - 'myPath/**'

This action runs when something is pushed under myPath but also on any pull request.

How I can limit this action to pull requests that contain changes under myPath?

CodePudding user response:

You have to repeat paths for each event type.

name: Run after changing anything in myPath package
on:
  pull_request:
    paths:
      - 'myPath/**'
  push:
    paths:
      - 'myPath/**'
  •  Tags:  
  • Related