Install the gh-token extension gh extension install Link-/gh-token Retrieve the installation access token for your GitHub App APP_ID=<APP ID> PRIVATE_KEY=<PATH TO PRIVATE KEY> INSTALLATION_ID=$(gh token installations --app-id $APP_ID --key $PRIVATE_KEY | jq '.[] | .id') TOKEN=$(gh token generate --app-id $APP_ID --key $PRIVATE_KEY --installation-id $INSTALLATION_ID | jq -r '.token') Validate the token and ensure the login value ends with [bot] curl -H "Authorization: bearer $TOKEN" -X POST -d " \ { \ \"query\": \"query { viewer { login }}\" \ } \ " https://api.github.com/graphql Clone a repo with the installation access token git clone https://x-access-token:$TOKEN@github.com/<org|owner>/<repo>.git