Skip to content

Commit

Permalink
Pass config_repositories as setting to avoid conflicts with `plugin…
Browse files Browse the repository at this point in the history
…_repositories` (#490)
  • Loading branch information
lowlighter authored Aug 19, 2021
1 parent f8531be commit d076839
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions source/app/action/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,9 @@ async function wait(seconds) {

//Base content
info.break()
const {base:parts, ...base} = metadata.plugins.base.inputs.action({core})
info.group({metadata, name:"base", inputs:base})
const {base:parts, repositories:_repositories, ...base} = metadata.plugins.base.inputs.action({core})
conf.settings.repositories = _repositories
info.group({metadata, name:"base", inputs:{repositories:conf.settings.repositories, ...base}})
info("Base sections", parts)
base.base = false
for (const part of conf.settings.plugins.base.parts)
Expand Down
3 changes: 2 additions & 1 deletion source/plugins/base/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
export default async function({login, graphql, rest, data, q, queries, imports}, conf) {
//Load inputs
console.debug(`metrics/compute/${login}/base > started`)
let {repositories, "repositories.forks":_forks, "repositories.affiliations":_affiliations, "repositories.batch":_batch} = imports.metadata.plugins.base.inputs({data, q, account:"bypass"}, {repositories:conf.settings.repositories ?? 100})
let {"repositories.forks":_forks, "repositories.affiliations":_affiliations, "repositories.batch":_batch} = imports.metadata.plugins.base.inputs({data, q, account:"bypass"})
const repositories = conf.settings.repositories || 100
const forks = _forks ? "" : ", isFork: false"
const affiliations = _affiliations?.length ? `, ownerAffiliations: [${_affiliations.map(x => x.toLocaleUpperCase()).join(", ")}]${conf.authenticated === login ? `, affiliations: [${_affiliations.map(x => x.toLocaleUpperCase()).join(", ")}]` : ""}` : ""
console.debug(`metrics/compute/${login}/base > affiliations constraints ${affiliations}`)
Expand Down

0 comments on commit d076839

Please sign in to comment.