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: Get template repo details from created repository #1549

Open
AmyShields-EN0085 opened this issue Oct 19, 2022 · 2 comments · May be fixed by #1579
Open

Feature Request: Get template repo details from created repository #1549

AmyShields-EN0085 opened this issue Oct 19, 2022 · 2 comments · May be fixed by #1579

Comments

@AmyShields-EN0085
Copy link

AmyShields-EN0085 commented Oct 19, 2022

It would be great to be able to get the template repository details from a created repo - so you could know what repository the created repo is based off.

This information is available through the rest API.

Example on a simple GET request to https://api.github.com/repos/org/reponame - I would love to expose the template_repository json object

{
    "id":xxxx,
    "node_id": "R_kgDOIQCw0A",
    "name": "test-generic-repo",
    "full_name": "orgt/test-generic-repo",
    "private": true,
    "**template_repository**": {
        "id": 470521023,
        "node_id": "R_kgDOHAuUvw",
        "name": "my-template",
        "full_name": "org/my-template",
        "private": true,
        "owner": {
            "login": "org",
            "id": 69310803,
            "avatar_url": "https://avatars.githubusercontent.com/u/69310803?v=4",
            "gravatar_id": "",
            "url": "https://api.github.com/users/org",
            "html_url": "https://github.com/org",
            "followers_url": "https://api.github.com/users/org/followers",
            "following_url": "https://api.github.com/users/org/following{/other_user}",
            "gists_url": "https://api.github.com/users/org/gists{/gist_id}",
            "starred_url": "https://api.github.com/users/org/starred{/owner}{/repo}",
            "subscriptions_url": "https://api.github.com/users/orgt/subscriptions",
            "organizations_url": "https://api.github.com/users/org/orgs",
            "repos_url": "https://api.github.com/users/org/repos",
            "events_url": "https://api.github.com/users/org/events{/privacy}",
            "received_events_url": "https://api.github.com/users/org/received_events",
            "type": "Organization",
            "site_admin": false
        }
    "network_count": 0,
    "subscribers_count": 0
}
@bitwiseman
Copy link
Member

PRs welcome.

robinvandenbogaard added a commit to robinvandenbogaard/github-api that referenced this issue Dec 14, 2022
@robinvandenbogaard robinvandenbogaard linked a pull request Dec 14, 2022 that will close this issue
10 tasks
@robinvandenbogaard
Copy link

robinvandenbogaard commented Dec 14, 2022

Here is the solution @bitwiseman

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

Successfully merging a pull request may close this issue.

3 participants