github-api icon indicating copy to clipboard operation
github-api copied to clipboard

Feature Request: Get template repo details from created repository

Open AmyShields-EN0085 opened this issue 3 years ago • 2 comments

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
}

AmyShields-EN0085 avatar Oct 19 '22 10:10 AmyShields-EN0085

PRs welcome.

bitwiseman avatar Oct 21 '22 18:10 bitwiseman

Here is the solution @bitwiseman

robinvandenbogaard avatar Dec 14 '22 14:12 robinvandenbogaard