简体   繁体   中英

Can I use GitHub API to extract the events of 'used by' of a repository?

GitHub supports listing the projects that depend on a repository . Can I extract the events (eg time) of these dependencies by GitHub API? If not, how can I get this information?

GitHub API v4 supports this feature in "preview" as of April 2018: https://developer.github.com/v4/previews/#access-to-a-repositories-dependency-graph .

I tried the following query, but the results seem strange to me.

{
    repository(owner:"tensorflow", name:"tensorflow") {
        dependencyGraphManifests{
            totalCount
        }
    }
}

The result is:

{'data': {'repository': {'dependencyGraphManifests': {'totalCount': 14}}}}

I tried to know why the totalCount is 14, so I run the following statments:

{
    repository(owner:"tensorflow", name:"tensorflow") {
        dependencyGraphManifests{
            edges{
              node{
                repository{
                 name
                }
              }
            }
        }
    }
}

The result is:

{'data': {'repository': {'dependencyGraphManifests': {'edges': [{'node': {'repository': {'name': 'tensorflow'}}}, {'node': {'repository': {'name': 'tensorflow'}}}, {'node': {'repository': {'name': 'tensorflow'}}}, {'node': {'repository': {'name': 'tensorflow'}}}, {'node': {'repository': {'name': 'tensorflow'}}}, {'node': {'repository': {'name': 'tensorflow'}}}, {'node': {'repository': {'name': 'tensorflow'}}}, {'node': {'repository': {'name': 'tensorflow'}}}, {'node': {'repository': {'name': 'tensorflow'}}}, {'node': {'repository': {'name': 'tensorflow'}}}, {'node': {'repository': {'name': 'tensorflow'}}}, {'node': {'repository': {'name': 'tensorflow'}}}, {'node': {'repository': {'name': 'tensorflow'}}}, {'node': {'repository': {'name': 'tensorflow'}}}]}}}}

Can anyone know why?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM