如何在github上找到我的组织ID? [英] How to find my organization Id over github?

查看:626
本文介绍了如何在github上找到我的组织ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何找到我的GitHub组织ID?

How I can find my GitHub organization id?

理想情况下,我可以通过脚本或命令来解析其输出.

Ideally through a script or a command I can parse its output.

推荐答案

来自组织API ,请访问

https://api.github.com/orgs?access_token=OAUTH-TOKEN

或输入:

curl -H "Authorization: token OAUTH-TOKEN" https://api.github.com/orgs

(用您自己的GitHub访问令牌替换OAUTH-TOKEN:请参见"使用OAuth令牌进行Git自动化"以获取或创建PAT:个人访问令牌)

(replace OAUTH-TOKEN by your own GitHub access token: see "Git automation with OAuth tokens" to get or create a PAT: a Personal Access Token)

您会发现,您可以在下面一个以上组织.

You will se that you can below to more than one organization.

每一个:

curl -H "Accept: application/json" -H "Authorization: token OAUTH-TOKEN" https://api.github.com/orgs/<anorg> | jq ".id"

使用 jq (轻量级命令行JSON处理器,对于所有操作系统(包括Windows), 都可用),您将直接获得ID.

With jq (lightweight command-line JSON processor, which is available for all OS including Windows), you will get directly the id.

这篇关于如何在github上找到我的组织ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆