When 'actions/checkout@v4' is used without any 'with:' parameters on a push event, what does it check out?
Select an answer to reveal the explanation.
Short Explanation and Infographic
By default, checkout grabs the exact commit that triggered your workflow — not a branch name, but the precise SHA.
Full explanation below image
Full Explanation
actions/checkout defaults to checking out the ref/SHA that triggered the workflow event, as provided in 'github.sha'. For push events, this is the pushed commit. For pull_request events, it's a merge commit of the PR into the base branch. The action also sets the repository in a 'detached HEAD' state for non-branch triggers. You can override with 'with: ref: main' to check out a specific branch, tag, or SHA. 'HEAD' in git refers to whatever commit is currently checked out — it's not different from the SHA in this context.