Hello Cloudflare community
I have some simple frontend apps on GitHub hooked into Cloudflare Pages with the Git Integration.
I mainly like to work in mono repositories. This has the side effect of triggering a Cloudflare build on every push in every branch, even if I haven’t touched the frontend files.
Is there a setting or config I have overlooked in the docs do enable a basic path filter, similar to path filters in GitHub actions?
I don’t believe this is possible directly today unfortunately. You could set your build command to a shell script or something that does an
exit 0 if it doesn’t match a specific condition, but that’s about it.
I’d recommend joining the Workers Discord to stay up to date on a lot of upcoming Pages things, including monorepo support which I know is on the team’s todo list.
Aw, that’s unfortunate. I will try your suggestion with a custom build script but I wonder what Pages behaviour will be on an
exit 0. I would guess it will be interpreted as a failed build which is also not desirable.
So I guess the only true options right now are to tolerate this behaviour as is and wait for an eventual support for mono repos, or split the code base into separate repositories.
Thanks for looking into this.
Yeah, definitely not the best behaviour today, but the team is definitely aware of the need for monorepo support, and I’m certain more first-class support will be coming in the future.