nx-set-shas
nx-set-shas copied to clipboard
Add ability to set default BASE_SHA instead of using HEAD~1 if no successful workflow run found
The current action sets the BASE_SHA
to HEAD~1
if it cannot find a successful workflow run. In my specific case, I created a monorepo and checked-in several commits before I got something that could be built successfully.
It would be great if I could either configure this action to use the first commit as the BASE_SHA
or specify a default BASE_SHA
myself.
Would this be possible?
An alternative might be to also set an environment variable, say LAST_SUCCESSFUL_WORKFLOW_FOUND, to either yes
or no
(or true
/false
). We could then use this to reset the BASE_SHA
environment variable to whatever SHA we wanted under these conditions.
You can propose a new PR that would introduce a new variable:
fallback_sha: ''
When specified, this would be used as a fallback instead of the HEAD~1
This would be useful also in use case where the 2nd workflow(triggered by workflow_dispatch from 1st workflow) want to check the affected projects from the previous workflow. Currently 2nd workflow always see same sha for both env.
Instead of fallback_sha, can we have base_sha
?