lindell / multi-gitter

Update multiple repositories in with one command
Apache License 2.0
819 stars 64 forks source link

Feature request: Document which permissions the tools needs exactly #471

Closed lehphyro closed 2 months ago

lehphyro commented 2 months ago

The feature request Document clearly which permissions listed at github docs are needed by multi-gitter.

My use case I'm not sure about which permissions to set on my PAT. I've set but it's not enough:

Metadata: Read-only
Pull requests: Read and write

Implementation

lehphyro commented 2 months ago

Here are the trace logs where I get a 404 error with my PAT:

TRAC[0000] http request                                  host=api.github.com request="GET /orgs/my-org/repos?page=1&per_page=100 HTTP/1.1
Host: api.github.com
User-Agent: go-github/v59.0.0
Accept: application/vnd.github.mercy-preview+json, application/vnd.github.nebula-preview+json
X-Github-Api-Version: 2022-11-28
Accept-Encoding: gzip

" response="HTTP/2.0 200 OK
Content-Length: 2
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
Cache-Control: private, max-age=60, s-maxage=60
Content-Security-Policy: default-src 'none'
Content-Type: application/json; charset=utf-8
Date: Wed, 10 Apr 2024 16:49:31 GMT
Etag: \"515c5279f749c9c96572c25c95f9a5b267cbef7ecdaeedff19bee33e0fd968a1\"
Github-Authentication-Token-Expiration: 2025-04-10 00:00:00 -0300
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Server: GitHub.com
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Vary: Accept, Authorization, Cookie, X-GitHub-OTP
Vary: Accept-Encoding, Accept, X-Requested-With
X-Accepted-Github-Permissions: metadata=read
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Github-Api-Version-Selected: 2022-11-28
X-Github-Media-Type: github.mercy-preview; param=nebula-preview; format=json
X-Github-Request-Id: 1A71:2CAB14:2305E88:237D8C1:6616C31B
X-Ratelimit-Limit: 5000
X-Ratelimit-Remaining: 4991
X-Ratelimit-Reset: 1712768052
X-Ratelimit-Resource: core
X-Ratelimit-Used: 9
X-Xss-Protection: 0

[]" took=441.918838ms
TRAC[0000] http request                                  host=api.github.com request="GET /repos/my-org/my-project HTTP/1.1
Host: api.github.com
User-Agent: go-github/v59.0.0
Accept: application/vnd.github.scarlet-witch-preview+json, application/vnd.github.mercy-preview+json, application/vnd.github.baptiste-preview+json, application/vnd.github.nebula-preview+json
X-Github-Api-Version: 2022-11-28
Accept-Encoding: gzip

" response="HTTP/2.0 404 Not Found
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
Content-Security-Policy: default-src 'none'
Content-Type: application/json; charset=utf-8
Date: Wed, 10 Apr 2024 16:49:31 GMT
Github-Authentication-Token-Expiration: 2025-04-10 00:00:00 -0300
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Server: GitHub.com
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Vary: Accept-Encoding, Accept, X-Requested-With
X-Accepted-Github-Permissions: metadata=read
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Github-Api-Version-Selected: 2022-11-28
X-Github-Media-Type: github.v3; param=scarlet-witch-preview; format=json, github.mercy-preview; param=baptiste-preview.nebula-preview; format=json
X-Github-Request-Id: 1A71:2CAB14:2305F00:237D93E:6616C31B
X-Ratelimit-Limit: 5000
X-Ratelimit-Remaining: 4990
X-Ratelimit-Reset: 1712768052
X-Ratelimit-Resource: core
X-Ratelimit-Used: 10
X-Xss-Protection: 0

{\"message\":\"Not Found\",\"documentation_url\":\"https://docs.github.com/rest/repos/repos#get-a-repository\"}" took=198.818605ms
lindell commented 2 months ago

From readme:

How to generate a GitHub personal access token. Make sure to give repo permissions.

lehphyro commented 2 months ago

There are no repo permissions.

lindell commented 2 months ago

image

lehphyro commented 2 months ago

That's for classic tokens, fine-grained personal access tokens don't work like that.

lindell commented 2 months ago

The fine-grained access token is in beta and does not work with APIs that is needed for multi-gitter to work (the GraphQL API).