Skip to content

github_my_repository Table Erroring With Fine-Grained Personal Access Token #520

@andy-werderman

Description

@andy-werderman

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.

Image

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

  1. Set the GITHUB_TOKEN environment variable to the fine grained token
export GITHUB_TOKEN=github_pat_...
  1. Query the github_my_repository table:
> 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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingsteampipeSteampipe plugin issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions