Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Authenticated user's private repos not listed #1715

Open
1 task done
Shpigford opened this issue Sep 12, 2024 · 2 comments
Open
1 task done

[BUG]: Authenticated user's private repos not listed #1715

Shpigford opened this issue Sep 12, 2024 · 2 comments
Labels
Type: Bug Something isn't working as documented

Comments

@Shpigford
Copy link

What happened?

I'm trying to access the currently authenticated user's private repos and at this point can't seem to get them listed with any endpoint or options.

I definitely have access to them as I can just pass in the the private repo to client.repo and it works fine.

I've used omniauth to connect to my GitHub account and then do this to auth the client:

@client = Octokit::Client.new(access_token: current_user.token)

No issues there.

@client.repositories(nil) — This returns all private repos (include org repos) EXCEPT for my personal ones.
@client.repositories('Shpigford') — This returns all of my public repos, but no private ones.

Not sure what else to try.

Versions

octokit gem (9.1.0)

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Shpigford Shpigford added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Sep 12, 2024
Copy link

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@kfcampbell kfcampbell removed the Status: Triage This is being looked at and prioritized label Sep 13, 2024
@kfcampbell kfcampbell moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Sep 13, 2024
@kfcampbell
Copy link
Member

So this is interesting: the SDK code is a pretty straightforward passthrough:

      def repositories(user = nil, options = {})
        paginate "#{User.path user}/repos", options
      end

to the API user repositories endpoint, which states that it "Lists public repositories for the specified user."

To get private repositories for a user, you must call the API endpoint to list repositories for the authenticated user.

It seems like there's an opportunity to add some functionality to the SDK here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

2 participants