Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert search queries to GraphQL queries #15

Open
rajbos opened this issue Jul 23, 2021 · 1 comment
Open

Convert search queries to GraphQL queries #15

rajbos opened this issue Jul 23, 2021 · 1 comment

Comments

@rajbos
Copy link
Owner

rajbos commented Jul 23, 2021

Gets all repos that have action.yaml or action.yml file in the root in one go, instead of loading all repositories and looping over them (not sure if we can include files in the query though).

Saves some calls for ratelimiting, which is helpful in a large environment.

@rajbos
Copy link
Owner Author

rajbos commented Aug 8, 2021

You can only request them in one go with a search query on repositories, which excludes forks :-(

query {
 search(first: 100, type: REPOSITORY, query: "org:rajbos") {
   repositoryCount
    edges {       
      node {
        ... on Repository {  
          nameWithOwner
          object(expression: "main:.action.yml") {
            ... on Tree {
              entries {
                name
              }
            }
          }
        }
      }
    }
  }
} 

Still it is worth converting it and then still go through all the repositories, but only do the manual check on repositories that are actual forks.

The normal repositories and files in it can then be checked through the GraphQL queries (1 for .yml and 1 for yaml).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant