【问题标题】:I am looking for project id on GitHub similar to project id on GitLab我在 GitHub 上寻找类似于 GitLab 上的项目 ID 的项目 ID
【发布时间】:2021-04-28 22:28:09
【问题描述】:

有没有办法在 GitHub 上检查项目 id,类似于 GitLab?我搜索了所有设置,但没有找到项目 ID。想知道是权限导致我看不到属性还是 GitHub 中没有项目 ID。

非常感谢您的帮助,并提前致谢。

【问题讨论】:

    标签: github-api github-actions


    【解决方案1】:

    我不确定它在 GitLab 上是如何组织的,但 GitHub 操作不是按项目创建的,而是按存储库创建的,所以也许这对你有用。您可以从 github 上下文 here 找到变量 - github.repository 为您提供:

    所有者和存储库名称。例如 Codertocat/Hello-World

    【讨论】:

      【解决方案2】:

      每个 Github 存储库都有一个 ID 和许多其他字段,您可以通过使用 Github API 来获取。

      如以上链接所述,您可以使用以下服务:

      要获取关于存储库的所有类型的数据:

      {
        "id": 1296269,
        "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
        "name": "Hello-World",
        "full_name": "octocat/Hello-World",
        "owner": {
          "login": "octocat",
          "id": 1,
          "node_id": "MDQ6VXNlcjE=",
          "avatar_url": "https://github.com/images/error/octocat_happy.gif",
          "gravatar_id": "",
          "url": "https://api.github.com/users/octocat",
          "html_url": "https://github.com/octocat",
          "followers_url": "https://api.github.com/users/octocat/followers",
          "following_url": "https://api.github.com/users/octocat/following{/other_user}",
          "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
          "organizations_url": "https://api.github.com/users/octocat/orgs",
          "repos_url": "https://api.github.com/users/octocat/repos",
          "events_url": "https://api.github.com/users/octocat/events{/privacy}",
          "received_events_url": "https://api.github.com/users/octocat/received_events",
          "type": "User",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/octocat/Hello-World",
        "description": "This your first repo!",
        "fork": false,
        "url": "https://api.github.com/repos/octocat/Hello-World",
        "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
        "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
        "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
        "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
        "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
        "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
        "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
        "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
        "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
        "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
        "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
        "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
        "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
        "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
        "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
        "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
        "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
        "git_url": "git:github.com/octocat/Hello-World.git",
        "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
        "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
        "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
        "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
        "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
        "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
        "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
        "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
        "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
        "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
        "ssh_url": "git@github.com:octocat/Hello-World.git",
        "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
        "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
        "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
        "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
        "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
        "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
        "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
        "clone_url": "https://github.com/octocat/Hello-World.git",
        "mirror_url": "git:git.example.com/octocat/Hello-World",
        "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks",
        "svn_url": "https://svn.github.com/octocat/Hello-World",
        "homepage": "https://github.com",
        "language": null,
        "forks_count": 9,
        "forks": 9,
        "stargazers_count": 80,
        "watchers_count": 80,
        "watchers": 80,
        "size": 108,
        "default_branch": "master",
        "open_issues_count": 0,
        "open_issues": 0,
        "is_template": false,
        "topics": [
          "octocat",
          "atom",
          "electron",
          "api"
        ],
        "has_issues": true,
        "has_projects": true,
        "has_wiki": true,
        "has_pages": false,
        "has_downloads": true,
        "archived": false,
        "disabled": false,
        "visibility": "public",
        "pushed_at": "2011-01-26T19:06:43Z",
        "created_at": "2011-01-26T19:01:12Z",
        "updated_at": "2011-01-26T19:14:43Z",
        "permissions": {
          "pull": true,
          "push": false,
          "admin": false
        },
        "allow_rebase_merge": true,
        "template_repository": {
          "id": 1296269,
          "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
          "name": "Hello-World-Template",
          "full_name": "octocat/Hello-World-Template",
          "owner": {
            "login": "octocat",
            "id": 1,
            "node_id": "MDQ6VXNlcjE=",
            "avatar_url": "https://github.com/images/error/octocat_happy.gif",
            "gravatar_id": "",
            "url": "https://api.github.com/users/octocat",
            "html_url": "https://github.com/octocat",
            "followers_url": "https://api.github.com/users/octocat/followers",
            "following_url": "https://api.github.com/users/octocat/following{/other_user}",
            "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
            "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
            "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
            "organizations_url": "https://api.github.com/users/octocat/orgs",
            "repos_url": "https://api.github.com/users/octocat/repos",
            "events_url": "https://api.github.com/users/octocat/events{/privacy}",
            "received_events_url": "https://api.github.com/users/octocat/received_events",
            "type": "User",
            "site_admin": false
          },
          "private": false,
          "html_url": "https://github.com/octocat/Hello-World-Template",
          "description": "This your first repo!",
          "fork": false,
          "url": "https://api.github.com/repos/octocat/Hello-World-Template",
          "archive_url": "https://api.github.com/repos/octocat/Hello-World-Template/{archive_format}{/ref}",
          "assignees_url": "https://api.github.com/repos/octocat/Hello-World-Template/assignees{/user}",
          "blobs_url": "https://api.github.com/repos/octocat/Hello-World-Template/git/blobs{/sha}",
          "branches_url": "https://api.github.com/repos/octocat/Hello-World-Template/branches{/branch}",
          "collaborators_url": "https://api.github.com/repos/octocat/Hello-World-Template/collaborators{/collaborator}",
          "comments_url": "https://api.github.com/repos/octocat/Hello-World-Template/comments{/number}",
          "commits_url": "https://api.github.com/repos/octocat/Hello-World-Template/commits{/sha}",
          "compare_url": "https://api.github.com/repos/octocat/Hello-World-Template/compare/{base}...{head}",
          "contents_url": "https://api.github.com/repos/octocat/Hello-World-Template/contents/{+path}",
          "contributors_url": "https://api.github.com/repos/octocat/Hello-World-Template/contributors",
          "deployments_url": "https://api.github.com/repos/octocat/Hello-World-Template/deployments",
          "downloads_url": "https://api.github.com/repos/octocat/Hello-World-Template/downloads",
          "events_url": "https://api.github.com/repos/octocat/Hello-World-Template/events",
          "forks_url": "https://api.github.com/repos/octocat/Hello-World-Template/forks",
          "git_commits_url": "https://api.github.com/repos/octocat/Hello-World-Template/git/commits{/sha}",
          "git_refs_url": "https://api.github.com/repos/octocat/Hello-World-Template/git/refs{/sha}",
          "git_tags_url": "https://api.github.com/repos/octocat/Hello-World-Template/git/tags{/sha}",
          "git_url": "git:github.com/octocat/Hello-World-Template.git",
          "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World-Template/issues/comments{/number}",
          "issue_events_url": "https://api.github.com/repos/octocat/Hello-World-Template/issues/events{/number}",
          "issues_url": "https://api.github.com/repos/octocat/Hello-World-Template/issues{/number}",
          "keys_url": "https://api.github.com/repos/octocat/Hello-World-Template/keys{/key_id}",
          "labels_url": "https://api.github.com/repos/octocat/Hello-World-Template/labels{/name}",
          "languages_url": "https://api.github.com/repos/octocat/Hello-World-Template/languages",
          "merges_url": "https://api.github.com/repos/octocat/Hello-World-Template/merges",
          "milestones_url": "https://api.github.com/repos/octocat/Hello-World-Template/milestones{/number}",
          "notifications_url": "https://api.github.com/repos/octocat/Hello-World-Template/notifications{?since,all,participating}",
          "pulls_url": "https://api.github.com/repos/octocat/Hello-World-Template/pulls{/number}",
          "releases_url": "https://api.github.com/repos/octocat/Hello-World-Template/releases{/id}",
          "ssh_url": "git@github.com:octocat/Hello-World-Template.git",
          "stargazers_url": "https://api.github.com/repos/octocat/Hello-World-Template/stargazers",
          "statuses_url": "https://api.github.com/repos/octocat/Hello-World-Template/statuses/{sha}",
          "subscribers_url": "https://api.github.com/repos/octocat/Hello-World-Template/subscribers",
          "subscription_url": "https://api.github.com/repos/octocat/Hello-World-Template/subscription",
          "tags_url": "https://api.github.com/repos/octocat/Hello-World-Template/tags",
          "teams_url": "https://api.github.com/repos/octocat/Hello-World-Template/teams",
          "trees_url": "https://api.github.com/repos/octocat/Hello-World-Template/git/trees{/sha}",
          "clone_url": "https://github.com/octocat/Hello-World-Template.git",
          "mirror_url": "git:git.example.com/octocat/Hello-World-Template",
          "hooks_url": "https://api.github.com/repos/octocat/Hello-World-Template/hooks",
          "svn_url": "https://svn.github.com/octocat/Hello-World-Template",
          "homepage": "https://github.com",
          "language": null,
          "forks": 9,
          "forks_count": 9,
          "stargazers_count": 80,
          "watchers_count": 80,
          "watchers": 80,
          "size": 108,
          "default_branch": "master",
          "open_issues": 0,
          "open_issues_count": 0,
          "is_template": true,
          "license": {
            "key": "mit",
            "name": "MIT License",
            "url": "https://api.github.com/licenses/mit",
            "spdx_id": "MIT",
            "node_id": "MDc6TGljZW5zZW1pdA==",
            "html_url": "https://api.github.com/licenses/mit"
          },
          "topics": [
            "octocat",
            "atom",
            "electron",
            "api"
          ],
          "has_issues": true,
          "has_projects": true,
          "has_wiki": true,
          "has_pages": false,
          "has_downloads": true,
          "archived": false,
          "disabled": false,
          "visibility": "public",
          "pushed_at": "2011-01-26T19:06:43Z",
          "created_at": "2011-01-26T19:01:12Z",
          "updated_at": "2011-01-26T19:14:43Z",
          "permissions": {
            "admin": false,
            "push": false,
            "pull": true
          },
          "allow_rebase_merge": true,
          "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
          "allow_squash_merge": true,
          "delete_branch_on_merge": true,
          "allow_merge_commit": true,
          "subscribers_count": 42,
          "network_count": 0
        },
        "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
        "allow_squash_merge": true,
        "delete_branch_on_merge": true,
        "allow_merge_commit": true,
        "subscribers_count": 42,
        "network_count": 0,
        "license": {
          "key": "mit",
          "name": "MIT License",
          "spdx_id": "MIT",
          "url": "https://api.github.com/licenses/mit",
          "node_id": "MDc6TGljZW5zZW1pdA=="
        },
        "organization": {
          "login": "octocat",
          "id": 1,
          "node_id": "MDQ6VXNlcjE=",
          "avatar_url": "https://github.com/images/error/octocat_happy.gif",
          "gravatar_id": "",
          "url": "https://api.github.com/users/octocat",
          "html_url": "https://github.com/octocat",
          "followers_url": "https://api.github.com/users/octocat/followers",
          "following_url": "https://api.github.com/users/octocat/following{/other_user}",
          "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
          "organizations_url": "https://api.github.com/users/octocat/orgs",
          "repos_url": "https://api.github.com/users/octocat/repos",
          "events_url": "https://api.github.com/users/octocat/events{/privacy}",
          "received_events_url": "https://api.github.com/users/octocat/received_events",
          "type": "Organization",
          "site_admin": false
        },
        "parent": {
          "id": 1296269,
          "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
          "name": "Hello-World",
          "full_name": "octocat/Hello-World",
          "owner": {
            "login": "octocat",
            "id": 1,
            "node_id": "MDQ6VXNlcjE=",
            "avatar_url": "https://github.com/images/error/octocat_happy.gif",
            "gravatar_id": "",
            "url": "https://api.github.com/users/octocat",
            "html_url": "https://github.com/octocat",
            "followers_url": "https://api.github.com/users/octocat/followers",
            "following_url": "https://api.github.com/users/octocat/following{/other_user}",
            "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
            "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
            "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
            "organizations_url": "https://api.github.com/users/octocat/orgs",
            "repos_url": "https://api.github.com/users/octocat/repos",
            "events_url": "https://api.github.com/users/octocat/events{/privacy}",
            "received_events_url": "https://api.github.com/users/octocat/received_events",
            "type": "User",
            "site_admin": false
          },
          "private": false,
          "html_url": "https://github.com/octocat/Hello-World",
          "description": "This your first repo!",
          "fork": false,
          "url": "https://api.github.com/repos/octocat/Hello-World",
          "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
          "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
          "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
          "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
          "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
          "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
          "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
          "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
          "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
          "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
          "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
          "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
          "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
          "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
          "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
          "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
          "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
          "git_url": "git:github.com/octocat/Hello-World.git",
          "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
          "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
          "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
          "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
          "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
          "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
          "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
          "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
          "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
          "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
          "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
          "ssh_url": "git@github.com:octocat/Hello-World.git",
          "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
          "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
          "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
          "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
          "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
          "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
          "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
          "clone_url": "https://github.com/octocat/Hello-World.git",
          "mirror_url": "git:git.example.com/octocat/Hello-World",
          "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks",
          "svn_url": "https://svn.github.com/octocat/Hello-World",
          "homepage": "https://github.com",
          "language": null,
          "forks_count": 9,
          "stargazers_count": 80,
          "watchers_count": 80,
          "size": 108,
          "default_branch": "master",
          "open_issues_count": 0,
          "is_template": true,
          "topics": [
            "octocat",
            "atom",
            "electron",
            "api"
          ],
          "has_issues": true,
          "has_projects": true,
          "has_wiki": true,
          "has_pages": false,
          "has_downloads": true,
          "archived": false,
          "disabled": false,
          "visibility": "public",
          "pushed_at": "2011-01-26T19:06:43Z",
          "created_at": "2011-01-26T19:01:12Z",
          "updated_at": "2011-01-26T19:14:43Z",
          "permissions": {
            "admin": false,
            "push": false,
            "pull": true
          },
          "allow_rebase_merge": true,
          "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
          "allow_squash_merge": true,
          "delete_branch_on_merge": true,
          "allow_merge_commit": true,
          "subscribers_count": 42,
          "network_count": 0,
          "license": {
            "key": "mit",
            "name": "MIT License",
            "url": "https://api.github.com/licenses/mit",
            "spdx_id": "MIT",
            "node_id": "MDc6TGljZW5zZW1pdA==",
            "html_url": "https://api.github.com/licenses/mit"
          },
          "forks": 1,
          "open_issues": 1,
          "watchers": 1
        },
        "source": {
          "id": 1296269,
          "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
          "name": "Hello-World",
          "full_name": "octocat/Hello-World",
          "owner": {
            "login": "octocat",
            "id": 1,
            "node_id": "MDQ6VXNlcjE=",
            "avatar_url": "https://github.com/images/error/octocat_happy.gif",
            "gravatar_id": "",
            "url": "https://api.github.com/users/octocat",
            "html_url": "https://github.com/octocat",
            "followers_url": "https://api.github.com/users/octocat/followers",
            "following_url": "https://api.github.com/users/octocat/following{/other_user}",
            "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
            "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
            "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
            "organizations_url": "https://api.github.com/users/octocat/orgs",
            "repos_url": "https://api.github.com/users/octocat/repos",
            "events_url": "https://api.github.com/users/octocat/events{/privacy}",
            "received_events_url": "https://api.github.com/users/octocat/received_events",
            "type": "User",
            "site_admin": false
          },
          "private": false,
          "html_url": "https://github.com/octocat/Hello-World",
          "description": "This your first repo!",
          "fork": false,
          "url": "https://api.github.com/repos/octocat/Hello-World",
          "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
          "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
          "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
          "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
          "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
          "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
          "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
          "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
          "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
          "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
          "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
          "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
          "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
          "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
          "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
          "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
          "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
          "git_url": "git:github.com/octocat/Hello-World.git",
          "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
          "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
          "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
          "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
          "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
          "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
          "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
          "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
          "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
          "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
          "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
          "ssh_url": "git@github.com:octocat/Hello-World.git",
          "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
          "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
          "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
          "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
          "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
          "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
          "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
          "clone_url": "https://github.com/octocat/Hello-World.git",
          "mirror_url": "git:git.example.com/octocat/Hello-World",
          "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks",
          "svn_url": "https://svn.github.com/octocat/Hello-World",
          "homepage": "https://github.com",
          "language": null,
          "forks_count": 9,
          "stargazers_count": 80,
          "watchers_count": 80,
          "size": 108,
          "default_branch": "master",
          "open_issues_count": 0,
          "is_template": true,
          "topics": [
            "octocat",
            "atom",
            "electron",
            "api"
          ],
          "has_issues": true,
          "has_projects": true,
          "has_wiki": true,
          "has_pages": false,
          "has_downloads": true,
          "archived": false,
          "disabled": false,
          "visibility": "public",
          "pushed_at": "2011-01-26T19:06:43Z",
          "created_at": "2011-01-26T19:01:12Z",
          "updated_at": "2011-01-26T19:14:43Z",
          "permissions": {
            "admin": false,
            "push": false,
            "pull": true
          },
          "allow_rebase_merge": true,
          "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
          "allow_squash_merge": true,
          "delete_branch_on_merge": true,
          "allow_merge_commit": true,
          "subscribers_count": 42,
          "network_count": 0,
          "license": {
            "key": "mit",
            "name": "MIT License",
            "url": "https://api.github.com/licenses/mit",
            "spdx_id": "MIT",
            "node_id": "MDc6TGljZW5zZW1pdA==",
            "html_url": "https://api.github.com/licenses/mit"
          },
          "forks": 1,
          "open_issues": 1,
          "watchers": 1
        }
      }

      如果存储库是公开的,则您无需任何权限即可访问这些数据。

      现在存储库是私有的,您需要在请求标头中使用您的PAT 才能访问它们。

      【讨论】:

        猜你喜欢
        • 2017-01-26
        • 2021-11-19
        • 2023-02-02
        • 2023-02-12
        • 1970-01-01
        • 2022-01-20
        • 1970-01-01
        • 2011-10-04
        • 2018-11-05
        相关资源
        最近更新 更多