docs icon indicating copy to clipboard operation
docs copied to clipboard

Misleading guidance on workflow filters

Open DavidSlayback opened this issue 1 year ago • 3 comments
trafficstars

Code of Conduct

What article on docs.github.com is affected?

Using Filters

What part(s) of the article would you like to see updated?

I didn't submit this as a PR because I don't know if the mistake is in Docs or in GitHub Actions.

In the docs, it states:

If you define both branches/branches-ignore and paths/paths-ignore, the workflow will only run when both filters are satisfied.

However, this is not true. Both in my own experience writing Actions for my company and in StackOverflow threads, it's clear that GitHub uses a logical OR instead of the implied AND from above. E.g., if I specify in a workflow:

on: 
  push:
    branches:
      - main
    paths:
      - "src/**"

I expect that the above should only trigger on a push to the main branch that alters files under src. However, it actually triggers on BOTH any push to main and any push to another branch that changes src files.

If this is the desired behavior, then the docs should be changed to reflect it. If it's not the desired behavior, then Actions should be changed to reflect the docs

Additional information

No response

DavidSlayback avatar Mar 29 '24 14:03 DavidSlayback

Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

welcome[bot] avatar Mar 29 '24 14:03 welcome[bot]

@DavidSlayback Thank you for opening this issue! I'll get this triaged for review ✨

nguyenalex836 avatar Mar 29 '24 17:03 nguyenalex836

Any updates on this? We wound up using a 3rd-party Github Action, but it'd be much cleaner to incorporate into the on trigger

DavidSlayback avatar Apr 23 '24 13:04 DavidSlayback

Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes:

github-actions[bot] avatar May 30 '24 18:05 github-actions[bot]

@DavidSlayback Hello! 👋 Thank you for your patience while our engineering team reviewed!

They are asking if you are able to replicate this in a public environment. Having an example they can look at, rather than needing to fabricate that repository structure and any user initiated changes would help them investigate further 💛

nguyenalex836 avatar Jun 11 '24 18:06 nguyenalex836

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. See this blog post on bug reports and the importance of repro steps for more information about the kind of information that may be helpful.

github-actions[bot] avatar Jun 25 '24 19:06 github-actions[bot]