Skip to content

Commit

Permalink
fix(plugins/followup): fallback to owner if collaborators are not acc…
Browse files Browse the repository at this point in the history
…essible (relates #859)
  • Loading branch information
lowlighter committed Feb 9, 2022
1 parent 2164e3c commit 4983bad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions source/plugins/followup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ The `plugin_followup_indepth` option collects additional stats to differentiate

It helps knowing whether repositories are also maintained by other users and give an overall health status of repositories.

> ⚠️ This mode will try to list users with push access to know who are the maintainers in order to place issues in the correct category, which requires a `repo` scope. If not available, it will consider that only the owner is a maintainer.
## ℹ️ Examples workflows

<!--examples-->
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/followup/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default async function({login, data, computed, imports, q, graphql, queri
console.debug(`metrics/compute/${login}/plugins > followup > processing ${owner}/${repo}`)
followup.indepth.repositories[`${owner}/${repo}`] = {stats:{}}
//Fetch users with push access
let {repository:{collaborators:{nodes:collaborators}}} = await graphql(queries.followup["repository.collaborators"]({repo, owner}))
let {repository:{collaborators:{nodes:collaborators}}} = await graphql(queries.followup["repository.collaborators"]({repo, owner})).catch(() => ({repository:{collaborators:{nodes:[{login:owner}]}}}))
console.debug(`metrics/compute/${login}/plugins > followup > found ${collaborators.length} collaborators`)
followup.indepth.repositories[`${owner}/${repo}`].collaborators = collaborators.map(({login}) => login)
//Fetch issues and pull requests created by collaborators
Expand Down

0 comments on commit 4983bad

Please sign in to comment.