-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Describe the bug
I am using a Fine-Grained PAT with all of the proper permissions. I set the organization as the resource owner for the PAT (instead of the user account itself). See the permissions configured in the screenshot.
The github_my_repository table then errors with Error: github: Resource not accessible by personal access token (SQLSTATE HV000).
When the same PAT is used to query the /user/repos API endpoint, it returns the expected set of repositories.
One thing to note, my organization requires SSO, although I would assume that issue would also present itself when using the REST API as well which is not happening. I think that part is solved by setting the organization as the resource owner.
When I use a Classic PAT and Configure SSO for the token, I am able to query all repos:
> select count(*) from github_my_repository;
+-------+
| count |
+-------+
| 1,637 |
+-------+
Steampipe version (steampipe -v)
Steampipe v2.2.0
Plugin version (steampipe plugin list)
v1.6.0
To reproduce
- Set the
GITHUB_TOKENenvironment variable to the fine grained token
export GITHUB_TOKEN=github_pat_...
- Query the
github_my_repositorytable:
> select * from github_my_repository;
Error: github: Resource not accessible by personal access token (SQLSTATE HV000)
Expected behavior
I would expect the github_my_repository table to be populated with all of the repositories in my organization (about 900 unarchived repositories).
Additional context
Slack thread: https://turbot-community.slack.com/archives/C06MZTFN90E/p1759427055096539