Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly set the ref (branch) when using workflow dispatch (#5953)
`github.head_ref` is empty when using workflow dispatch to trigger the workflow. According to https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context, `github.head_ref is only available when the event that triggers a workflow run is either `pull_request` or `pull_request_target`. The fix is to do the same as SHA by checking for the event name and set the branch accordingly. ### Testing https://github.com/pytorch/pytorch/actions/workflows/inductor-perf-test-nightly-macos.yml at https://github.com/pytorch/pytorch/actions/runs/11939943706
- Loading branch information