Accessing commit range from triggering workflow when using workflow_run

I’m trying to setup a workflow where the CI triggers another workflow after completion the triggered workflow needs to know the before commit that was available in the CI workflow. The CI workflow is triggered on pull_request (opened, reopened, ready_for_review) as well as push.

From what I understand you can retrieve the reference by using github.event.workflow_run.head_branch, but is there any way to access for before sha that’s available in the CI workflow through github.event.before?

Right now I’m getting around this by using actions/github-script and the github.rest.actions.createWorkflowDispatch() call available there. But I’m hoping there’s a simpler (cleaner) way of doing this through the workflow_run event.

Actually I’ve found a bit of a workaround, by having the CI do the checks needed, before calling github.rest.actions.createWorkflowDispatch() which ironically solves another problem with the second workflow where it would be flagged as passed even if it didn’t do anything.

That being said it would still be nice to be able to access the before commit hash/ref in the workflow triggered by workflow_run.