Open tamoreton opened 1 year ago
I'm getting the same issue when using a Github OAuthApp :
// Authentication
this.github.app = new OAuthApp({
clientType: "oauth-app",
clientId: this.config.client_id,
clientSecret: this.config.client_secret,
})
// Request
request: {
method: 'GET',
url: 'https://api.github.com/repos/<owner>/<repo>/contents/.github%2Fworkflows%2Fmywf.yml%3Fref%3Dfeature%2F1-add-checkout-and-deploy-to-github-actions',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit.js/2.0.14 octokit-core.js/4.2.0 Node.js/18.16.0 (darwin; x64)',
authorization: 'token [REDACTED]'
}
Response.status
is 404
Do you think that this is related to https://github.com/octokit/endpoint.js/issues/207 (which has been fixed) ?
What happened?
When using
octokit.rest.repos.getContent
likeusing a classic PAT that looks like
ghp_[REDACTED]
, it works as expected. However, I want to use a fine-grained token with read access to just the repo I need content from for security reasons. When I do exactly the same call as above but substituting a fine-grained PAT that looks likegithub_pat_[REDACTED]
, I get aRequestError [HttpError]: Not Found
. When I log the response I note that therequest
field looks like:It seems that for some reason, using a fine-grained PAT causes
getContent
to go down a branch which URL-encodespath
.Versions
Octokit.js v2.0.14, Node v18.13.0
Relevant log output
No response
Code of Conduct