【问题标题】:How do I query the GitHub v4 API for directory contents at a certain tag?如何在 GitHub v4 API 中查询特定标签的目录内容?
【发布时间】:2017-12-08 17:47:30
【问题描述】:

如何在GitHub API v4查询某个仓库的某个目录在某个标签下的内容?

这是迄今为止我想出的最好的:

query {
  repository(owner:"example", name:"example") {
    refs(refPrefix: "tags") {
    }
  } 
}

【问题讨论】:

    标签: graphql github-api github-graphql


    【解决方案1】:

    this post,您可以获得GitObjectobject 以过滤branch:/path/folder 并打印Tree。以下将从标签gson-2.4 中的gson 文件夹中获取树并打印nametypemode

    query {
      repository(owner:"google", name:"gson") {
          object(expression: "gson-2.4:gson") {
          ... on Tree{
            entries{
              name
              type
              mode
            }
          }
        }
      } 
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-08
      • 2017-12-05
      • 2018-08-21
      • 1970-01-01
      • 2020-06-29
      • 2022-01-06
      • 1970-01-01
      • 2021-01-14
      相关资源
      最近更新 更多