Glob patterns not working for me #26145
-
Howdy! I am working on a project in a monorepo. Each package is an individual static site generated by Eleventy, and we are deploying to CloudFlare Workers Sites. All of the sites follow a very similar structure and have the same config, so I’m using hygen to be able to generate all the boilerplate for a new site easily. I’m also hoping to use this to generate a Workflow for each site’s staging and prod environments. On each Pull Request, I want to build and deploy staging instances of whatever package(s) (sites) I was working on for that PR. Initially, I thought I could do this by pattern matching the branch name but I had issues getting the glob pattern to match. The idea being I could prepend any branch related to Example:
^ does not work. But then I read about So I tried:
But to no avail. When I open a PR, it triggers, but it also seems to trigger even when_ no files were modified inside a path containing Here’s the full config for site-a’s staging workflow right now:
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Did you try this by chance?
That pattern might match what you’re looking to accomplish if I’m not mistaken. If that fails, maybe you could try using the if conditional at the job level (which is admittedly cumbersome if you have several jobs). https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idif |
Beta Was this translation helpful? Give feedback.
-
Did you try this by chance?
That pattern might match what you’re looking to accomplish if I’m not mistaken. If that fails, maybe you could try using the if conditional at the job level (which is admittedly cumbersome if you have several jobs). https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idif |
Beta Was this translation helpful? Give feedback.
-
Update: I found this thread and am I understanding correctly that my If so, that’s really unfortunate for my situation. |
Beta Was this translation helpful? Give feedback.
-
Hi @jchiatt , For ‘pull_request’ event, the default types are: opened, synchronize, and reopened. But to no avail. When I open a PR, it triggers, but it also seems to trigger even when_ no files were modified inside a path containing _>> _If you triggered a workflow from PR but not close PR, edit a ‘not-site-a’ file, the workflow will still be triggered since event type ‘synchronize’ is met, and ‘paths’ fiter check the whole PR files including the previous ‘site-a’ file. Hence, you can specify the type together with ‘paths’ to avoid this situation, code sample as below:
Hope it helps! |
Beta Was this translation helpful? Give feedback.
-
This makes sense to me now! Thanks for the help. |
Beta Was this translation helpful? Give feedback.
Hi @jchiatt ,
For ‘pull_request’ event, the default types are: opened, synchronize, and reopened.
But to no avail. When I open a PR, it triggers, but it also seems to trigger even when_ no files were modified inside a path containing
site-a
.__>> _If you triggered a workflow from PR but not close PR, edit a ‘not-site-a’ file, the workflow will still be triggered since event type ‘synchronize’ is met, and ‘paths’ fiter check the whole PR files including the previous ‘site-a’ file.
Hence, you can specify the type together with ‘paths’ to avoid this situation, code sample as below:
Hope it helps!