Manage Git credentials and authentication
mainBy default, actions/checkout@v2 persists credentials (PAT or SSH key) in the local git config. This allows you to run authenticated git commands (like git fetch or git commit) in subsequent workflow steps.
Using PATs
When using a PAT, the token is stored in the local git config via http.https://github.com/.extraheader. This enables an AUTHORIZATION: basic <BASE64_U:P> header for all authenticated commands.
Using SSH Keys
When using an ssh-key, the key is written to $RUNNER_TEMP and the core.sshCommand is configured to use it. The key and the temporary host key database are removed by the action's post-job hook.
Opting out
To prevent credentials from being stored on disk, set persist-credentials: false.
Git Commit Configuration
If you are scripting git commit, you must manually set your identity as the action does not provide defaults:
git config user.name <NAME>
git config user.email <EMAIL>