on.pull_request.paths-ignore are not respected correctly
See original GitHub issueDescribe the bug
According to the documentation we can use paths-ignore
in the same way for pull_request
events as we can do for push
events on.<push|pull_request|pull_request_target>.<paths|paths-ignore>.
However, if we define a workflow like the following, the behavior differs:
name: Echo Date
on:
push:
paths-ignore:
- 'README.md'
pull_request:
types: [opened, synchronize]
paths-ignore:
- 'README.md'
jobs:
echo-date:
runs-on: ubuntu-latest
name: "Echo"
steps:
- name: Run echo date
run: |
echo -e "Hello at $(date -I)"
Although it seems to be working at the beginning when I (1) created a pr, (2) pushed a change on README.md
and (3) nothing triggered, the behavior changed as soon as one commit of the pr references a file outside of the paths-ignore
list.
After a change to a file outside of the paths-ignore
list, all following commits trigger the workflow.
Someone else mentioned a problem here as well: https://github.com/actions/runner/issues/545#issuecomment-1321467176
To Reproduce You can find a minimal example here: https://github.com/GRBurst/pull_requests.paths
Steps to reproduce the behavior:
- Create an action as above (or fork the example)
- Create a new branch and a pr
- Add commits, where at least one commit changes a file outside the
paths-ignore
declaration - Check that all following commits trigger the workflow (the pull_request events triggers, the push does not).
Expected behavior
I expect that the conditions to run the actions only take the last commit into account.
So if I have commit that changes a file outside the path definition, it triggers the workflow.
If a following commit does only changes to files declared in the paths-ignore
list, the workflow should not trigger.
Runner Version and Platform
Version of your runner? -> 2.299.1
OS of the machine running the runner? OSX/Windows/Linux/… -> Ubuntu, 22.04.1, LTS
Issue Analytics
- State:
- Created 9 months ago
- Reactions:19
- Comments:5
Top GitHub Comments
Can confirm the bug
It’s been half a year, any news on this?