I'm using Nx for monorepo support on a new project. One of the benefits of Nx is that it can determine which apps in the monorepo are affected by a range of changes (start commit, end commit). So if you have a bunch of apps, you only have to build, test, and deploy the apps that are actually affected by the changes instead of the entire monorepo.
GitHub provides an env variable
GITHUB_SHA but that's the commit that triggered the workflow (i.e. the "end commit"). It also provides
GITHUB_BASE_REF but that only works on workflows running from a forked repo comparing to the head repo.
pipeline.git.base_revision for this purpose. Do GitHub Actions have something similar?