I have created a Fine grained PAT for my organization to manage self-hosted runners.
Command I try to do it actions/runners/registration-token
:
curl -Li -H "Accept: application/vnd.github+json" -H "Authorization: Token
github_pat_..." -H "X-GitHub-Api-Version: 2022-11-28"
https://api.github.com/orgs/.../actions/runners/registration-token
HTTP/2 403
server: GitHub.com
date: Tue, 07 May 2024 21:31:53 GMT
content-type: application/json; charset=utf-8
github-authentication-token-expiration: 2024-08-05 20:57:52 +0200
x-github-media-type: github.v3; format=json
x-accepted-github-permissions: organization_self_hosted_runners=read
x-github-api-version-selected: 2022-11-28
x-github-request-id: 813F:EF368:331761F7:334F3EB0:663A9DC9
{
"message": "Resource not accessible by personal access token",
"documentation_url": "https://docs.github.com/rest/actions/self-hosted-
runners#get-a-self-hosted-runner-for-an-organization"
}
But my token HAS this permission: