This PR adds and updates actions/checkout by including ref and repository.
ref: ${{ github.event.pull_request.head.ref }}: This specifies the branch or tag ref that should be checked out. In this case, it's dynamically set to the branch associated with the pull request that triggered the workflow.
repository: ${{ github.event.pull_request.head.repo.full_name }}: This specifies the repository to be checked out. It's dynamically set to the repository associated with the pull request that triggered the workflow. This is useful when the workflow is triggered by a pull request from a forked repository.
If you commit directly to the main branch instead of creating a pull request, the github.event.pull_request.head.ref value will not be available and the actions/checkout action will default to checking out the commit that triggered the workflow run.
This PR adds and updates
actions/checkout
by includingref
andrepository
.ref: ${{ github.event.pull_request.head.ref }}
: This specifies the branch or tag ref that should be checked out. In this case, it's dynamically set to the branch associated with the pull request that triggered the workflow.repository: ${{ github.event.pull_request.head.repo.full_name }}
: This specifies the repository to be checked out. It's dynamically set to the repository associated with the pull request that triggered the workflow. This is useful when the workflow is triggered by a pull request from a forked repository.If you commit directly to the main branch instead of creating a pull request, the
github.event.pull_request.head.ref
value will not be available and theactions/checkout
action will default to checking out the commit that triggered the workflow run.