Repository: add action users metrics (#472)
This commit is contained in:
@@ -63,6 +63,18 @@ export default async function({login, q}, {data, rest, graphql, queries, account
|
||||
//Override plugins parameters
|
||||
q["projects.limit"] = 0
|
||||
|
||||
//Fetching users count if it's an action
|
||||
try {
|
||||
if (await rest.repos.getContent({owner:login, repo, path:"action.yml"})) {
|
||||
console.debug(`metrics/compute/${login}/${repo} > this repository seems to be a GitHub action, fetching users using code search`)
|
||||
const {data:{total_count}} = await rest.search.code({q:`uses ${login} ${repo} path:.github/workflows language:YAML`})
|
||||
data.repo.actionUsersCount = total_count
|
||||
}
|
||||
}
|
||||
catch {
|
||||
//Ignore errors
|
||||
}
|
||||
|
||||
//Core
|
||||
await imports.plugins.core(...arguments)
|
||||
await Promise.all(pending)
|
||||
|
||||
Reference in New Issue
Block a user