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

[ feature request ] list repos for organization #734

Open
yonas opened this issue Nov 18, 2024 · 2 comments
Open

[ feature request ] list repos for organization #734

yonas opened this issue Nov 18, 2024 · 2 comments

Comments

@yonas
Copy link

yonas commented Nov 18, 2024

List all forks of an organization owned by the currently authenticated user.

For example, in

use octocrab::Octocrab;

#[tokio::main]
async fn main() -> octocrab::Result<()> {
    let token = std::env::var("GITHUB_TOKEN").expect("GITHUB_TOKEN env variable is required");

    let octocrab = Octocrab::builder().personal_token(token).build()?;

    let my_repos = octocrab
        .current()
        .list_repos_for_authenticated_user()
        .type_("owner")
        .sort("updated")
        .per_page(100)
        .send()
        .await?;

    for repo in my_repos {
        println!("{}", repo.name);
    }

    Ok(())
}

I would like to replace list_repos_for_authenticated_user() with something like list_repos_for_authenticated_user("myorg").

@dmgorsky
Copy link
Contributor

There are APIs for
"List organizations for the authenticated user"
https://docs.github.com/en/rest/orgs/orgs?apiVersion=2022-11-28#list-organizations-for-the-authenticated-user
and
"List organization repositories"
https://docs.github.com/en/rest/repos#list-organization-repositories

Will they be enough? I can check the code then.

@yonas
Copy link
Author

yonas commented Feb 20, 2025

@dmgorsky Thanks, but those are not sufficient.

I want to pass in the organization since I have multiple orgs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants