My GitHub Action is set up to be triggered on push. It works fine when I don't use a path: argument (or I hardcode file paths in it), but it does not work if I use a pattern or wildcard.
Here is the relative portion of my Action:
name: "Publish YAML files"
on:
push:
branches:
- master
- main-github-test
paths:
- '**.yaml'
- '**.yml'
The expectation is that my Action will get triggered whenever any file in my repository with the .yaml or .yml extension is modified and pushed to either or the two specified branches. My assumption is that this wildcard searches recursively throughout my repository from the root to the bottom.
But this is not happening.
If I hardcode specific paths (e.g. docs/myfile.yml), it works fine. But somehow it doesn't like my pattern/wildcard, even though I'm doing everything "the right way" according to GitHub's own documentation (see this).
What am I doing wrong?
What I tried:
paths: argument in my Action: paths:
- '**.yaml'
- '**.yml'
Expected behavior:
Actual behavior.
paths: argument entirely.Please try this
name: "Publish YAML files"
on:
push:
branches:
- master
- main-github-test
paths:
- '**/*.yaml'
- '**/*.yml'
It will catch all yaml and yml files.
You can read about globbing here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With