When running GitHub CLI in context of a GitHub Action, the GITHUB_TOKEN provided by default is an Apps integration token. If gh is eventually available through Codespaces, the situation will be the same. Integration tokens have different abilities than OAuth tokens/PATs, for example:
- Actions-provided one will always be scoped to a single repository;
- They don't have a concept of OAuth scopes, and thus no
x-oauth-scopes HTTP response header;
- Server-to-server tokens are not able to access the REST
/user or the GraphQL viewer resource.
Ideally, most GitHub CLI functionality should continue to work if gh was provided an integration token instead of an OAuth one. In cases when that is not possible, we should provide better error messaging to the user to help them understand what is happening.
Ref. #1413
Ref. #1314 #1074
When running GitHub CLI in context of a GitHub Action, the GITHUB_TOKEN provided by default is an Apps integration token. If gh is eventually available through Codespaces, the situation will be the same. Integration tokens have different abilities than OAuth tokens/PATs, for example:
x-oauth-scopesHTTP response header;/useror the GraphQLviewerresource.Ideally, most GitHub CLI functionality should continue to work if gh was provided an integration token instead of an OAuth one. In cases when that is not possible, we should provide better error messaging to the user to help them understand what is happening.
Ref. #1413
Ref. #1314 #1074