GitHub API 和电子邮件地址

标签 github github-api

我正在尝试提取我的组织内所有用户的电子邮件地址。 我的 GraphQL 查询如下所示:

{
  organization(login: "####") {
    membersWithRole(first: 100) {
      totalCount
      edges {
        node {
          login
          name
          email
        }
      }
      pageInfo {
        endCursor
        hasNextPage
      }
    }
  }
}

但是,它仅在用户公开显示电子邮件时才显示。我需要这个的原因是从我的组织中删除已离开/取消的用户。

谢谢

最佳答案

it only shows the email if the user has made it publicly shown.

是的,这意味着私有(private)电子邮件不会被查询,或者如 explained here :

some users don't have an e-mail address defined in github.com/settings/profile and that causes the email field in the API response to be blank.

asked before ,单独使用电子邮件是行不通的,因为私有(private)电子邮件不会成为此类查询的一部分。

这可以给你 User node is null if email is private or unset .

您的情况需要其他方法,例如 Get last activity for a user in an organisation GitHub Ecosystem .

关于GitHub API 和电子邮件地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71951205/

相关文章:

git - 无法使用 octopress 部署到 Github Pages

ios - Xcode 7 GM 无法验证 git 存储库

javascript - 如何维护isAuth并保护私有(private)路由?

github-api - 为什么速率限制与 GitHub API 的授权和匿名访问相似?

angular - GitHub 操作 - 错误未定义 : No tag found in ref or input

git - git bash 提示符发生了什么?

Git fetch 浅克隆没有获取匹配的提交

php - cUrl 正在返回 JSON 字符串,json_decode 没有将其解码为对象或数组

github-api - GitHub 应用程序访问私有(private)成员和存储库

github - 在 GitHub 中查看最活跃的 fork 的直观方式