Skip to content

Using hub from GitHub Actions #2149

@rtimush

Description

@rtimush

When hub api is called from a GitHub Action with a GITHUB_TOKEN available without any additional configuration it fails with "Bad credentials".

Command:

HUB_VERBOSE=true hub api /repos/rtimush/test/git/refs

Output:

$ git rev-parse -q --git-dir
$ git remote -v
$ git config --get-all hub.host
> GET https://api.github.com/user
> Authorization: token [REDACTED]
> Accept: application/vnd.github.v3+json;charset=utf-8
< HTTP 403
{"message":"Resource not accessible by integration","documentation_url":"https://developer.github.com/v3/users/#get-the-authenticated-user"}
> GET https://api.github.com/repos/rtimush/test/git/refs
> Authorization: token 
> Accept: application/vnd.github.v3+json;charset=utf-8
< HTTP 401
{"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}
{"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions