We make heavy use of
on: push: paths: - "something/**"
For scoping Workflows related to some sub-component of our monorepository to only run when code within that component has changed.
We find very frequently the Workflows run when we’re not expecting them to. Is there any documentation on exactly how the “changed paths” list that is matched to this glob is computed?
From a user’s perspective, I’d expect it to match the list of changed files in the PR diff view at the time of push. Technically speaking, I’d expect it to be:
mb=$(git merge-base "$base_branch" HEAD) git diff --name-only "$mb"
But we see these scoped Workflows run when there are no matched paths by those approaches.
Anecdotally, it seems to be related to syncing from the base branch. When we merge in
main or rebase + force-push is when the Workflows seem to run unnecessarily.