Which pair of github context properties correctly identifies both the event type that started the run and the full git ref for the commit?
Select an answer to reveal the explanation.
Short Explanation and Infographic
github.event_name is the string event type (push, pull_request, etc.), and github.ref is the full ref like refs/heads/main. Those two are the standard pair for trigger plus ref.
Full explanation below image
Full Explanation
The github context includes event_name (the triggering event as a string, e.g. push or workflow_dispatch) and ref (the fully formed git ref such as refs/heads/main or refs/tags/v1.0.0). Together they answer what fired this workflow and which ref is in context. github.event is the entire payload object, not the event type name. github.branch is not a standard top-level github context field. github.trigger does not exist. github.action identifies the currently executing action, and github.sha is the commit SHA — useful, but not the full ref. For short names without refs/heads/, use github.ref_name; for the long form required by some APIs, use github.ref.