-
Notifications
You must be signed in to change notification settings - Fork 85
Description
nx-set-shas currently determines the BASE SHA by locating the last successful CI workflow run on your main branch (or falling back to HEAD~1 or a provided fallback SHA) and always uses that commit as the “base” for nx affected calculations . In our release pipeline we insert version-bump and changelog commits annotated with [skip ci] (or [ci skip]) after the last successful workflow run. Because those commits never generate a “successful” workflow, nx-set-shas continues to pick the older workflow’s commit instead of the more recent skip-ci commit, causing our affected diff to miss changes introduced during versioning.
Current behavior
On push events to main, the action runs findSuccessfulCommit(...) to retrieve the last successful workflow run’s SHA via GitHub’s Actions API .
If none is found, it warns (or errors if error-on-no-successful-workflow: true) and falls back to either fallback-sha or HEAD~1/empty-tree .
It never considers commits marked [skip ci], because those never report “success” to the Actions API .
Desired behavior
We’d like an optional input flag, e.g. use-skip-ci-commits-as-base, which when set to true will:
Scan the main branch’s commit history for the most recent commit whose message matches /[(ci skip|skip ci)]/i.
Use that commit’s SHA as BASE before falling back to the existing “last successful workflow” logic.
Preserve current behavior when the flag is false or unset.