We’re trying to utilize the path-filtering orb to only run database migrations on our release/deploy branches when we have a new one to run, and are having two problems.
The first problem we’ve noticed is if we’re using pipeline.git.branch as the base-revision, it is only comparing the latest commit to the branch, and thus will only run migrations if there’s a change in the latest commit we’re merging to a release branch. This is a monorepo and thus we’ve got a ton of devs merging, so the likelihood that the latest commit merged to a release branch actually has a migration is pretty low, and thus we’d never run migrations even when we need to.
To work around that, we’ve set base-revision to pipeline.git.base_revision. This works for branches that have already existed, but for new branches (i.e. a PR gets created), the base-revision always defaults to main, instead of the actual default branch (which we’ve still got set to master on this repo).
Basically, I’m looking for a solution that either allows us to compare all of the commits in a push to the base, or a way to have base-revision set to our actual default branch name if it’s a new branch. Any help or advice is greatly appreciated!