Using gh to access private repos via https (e.g. when ssh not allowed)

Settings -> Developer Settings -> Personal access token -> Fine-grained personal access tokens

Do not forget setting "Contents : Read-only" in "Permissions".

gh auth login --with-token < github-token

If wanted to set credential.helper

gh auth refresh
[remote "origin"]
        url = https://github.com/foo/bar.git
git pull

GitHub Actions でプライベートリポジトリを checkout する (japanese)