Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading guidance on workflow filters #32291

Open
1 task done
DavidSlayback opened this issue Mar 29, 2024 · 3 comments
Open
1 task done

Misleading guidance on workflow filters #32291

DavidSlayback opened this issue Mar 29, 2024 · 3 comments
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team waiting for review Issue/PR is waiting for a writer's review

Comments

@DavidSlayback
Copy link

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 DavidSlayback added the content This issue or pull request belongs to the Docs Content team label Mar 29, 2024
Copy link

welcome bot commented Mar 29, 2024

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.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Mar 29, 2024
@nguyenalex836 nguyenalex836 added actions This issue or pull request should be reviewed by the docs actions team and removed triage Do not begin working on this issue until triaged by the team labels Mar 29, 2024
@nguyenalex836
Copy link
Contributor

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

@nguyenalex836 nguyenalex836 added the waiting for review Issue/PR is waiting for a writer's review label Mar 29, 2024
@DavidSlayback
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team waiting for review Issue/PR is waiting for a writer's review
Projects
None yet
Development

No branches or pull requests

2 participants