Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 5

On push.path doesn't work

We have a github setup that should only trigger on filechanges in certain dirs or absolute files. I prefer not to exclude the rest.

It looks like this flow isn't working since it will trigger on any commit.

name: Pecl builder

on:
  create:
    tags:
  push:
    paths:
      - .github/workflows/pecl.yml
      - package.xml
      - 'build/php7/safe/**'
      - LICENSE.txt
      - CHANGELOG-4.0.md
      - CODE_OF_CONDUCT.md
      - CODE_OWNERS.TXT

 

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-...

 

From the documentation I understood that only a action should run if one of the files in paths changed.

 

See full yaml here: https://github.com/phalcon/cphalcon/blob/master/.github/workflows/pecl.yml

 

Anybody else experience this?

4 Replies
Highlighted
GitHub Partner
Message 2 of 5

Re: On push.path doesn't work

Hi @ruudboon,

 

I forked your repo, workflow is NOT triggered for the file change out of 'paths' list. 

For instance, tests/_data/fixtures/Traits/Db/MysqlTrait.php , i notice push event is triggered on your '4.0.x' branch but however it's not in my repo.

Please confirm whether it's reproduce in your other repo. And if the issue persists, it's recommended to search private support here: https://support.github.com/contact, thanks!

 

Copilot Lvl 3
Message 3 of 5

Re: On push.path doesn't work

Highlighted
Ground Controller Lvl 1
Message 4 of 5

Re: On push.path doesn't work

Hello ruudboon!

 

Let me share my experiences with paths:

 

When you push to the repository, a set of changed files gets created against which paths is compared. This set includes every file from the start of the branch until the latest commit.

 

My misconeption was that only files in the latest push are used to match agains paths.

 

For your example this means, that when you change the file package.xml in a branch, this workflow will always trigger even if subsequent commits don't change any of the files in paths.

 

HTH.

Highlighted
Copilot Lvl 3
Message 5 of 5

Re: On push.path doesn't work

Ah thnx. That looks indeed like the case.

Wondering if this is intended to work like this. I would make sense to trigger only on certain file changes. I got a ticket running at github, let's see what they say.