【问题标题】:Get contributions in Gitlab在 Gitlab 中获得贡献
【发布时间】:2020-09-03 06:13:03
【问题描述】:

目前在 github 中,我可以使用 GraphQL API 获得我去年的贡献。

{
  user(login: "username") {
    contributionsCollection {
      contributionCalendar {
        weeks {
          contributionDays {
            contributionCount
            date
            color
          }
        }
      }
    }
  }
}

我无法在 gitlab GraphQL API 中找到等价物。是否有可能在 gitlab 中有这些信息?即使它不使用 GraphQL 也没关系,只是希望能够收集它。

【问题讨论】:

    标签: git github graphql gitlab


    【解决方案1】:

    您可以从事件 API 中获取用户的贡献:
    https://docs.gitlab.com/ee/api/events.html#get-user-contribution-events

    https://gitlab.example.com/api/v4/users/:id/events
    

    您还可以在用户页面上获取用户最近贡献的 JSON 表示

    https://gitlab.example.com/users/:username/contributions.json
    

    【讨论】:

    • 我认为这行不通,因为它不会显示私有贡献,对吧?在 github API 中,如果用户选择显示它,它将返回,但不会指定是什么,这对我来说很好。
    • 另外,找不到第二个的文档,有链接吗?
    猜你喜欢
    • 2020-02-29
    • 1970-01-01
    • 1970-01-01
    • 2017-11-18
    • 1970-01-01
    • 2017-03-03
    • 2011-09-13
    • 1970-01-01
    • 2021-04-27
    相关资源
    最近更新 更多