fix(plugins/code,habits,languages): support basic login as authoring (#650)

This commit is contained in:
Simon Lecoq
2021-11-03 23:19:32 -04:00
committed by GitHub
parent f873920871
commit 23f0ba8e0b
3 changed files with 4 additions and 3 deletions

View File

@@ -32,7 +32,8 @@ export default async function({login, q, imports, data, rest, account}, {enabled
.filter(event => visibility === "public" ? event.public : true) .filter(event => visibility === "public" ? event.public : true)
.flatMap(({payload}) => Promise.all(payload.commits.map(async commit => (await rest.request(commit.url)).data)))])] .flatMap(({payload}) => Promise.all(payload.commits.map(async commit => (await rest.request(commit.url)).data)))])]
.flat() .flat()
.filter(({author}) => data.shared["commits.authoring"].filter(authoring => author?.email?.toLocaleLowerCase().includes(authoring)||author?.name?.toLocaleLowerCase().includes(authoring))) .filter(({parents}) => parents.length <= 1)
.filter(({author}) => data.shared["commits.authoring"].filter(authoring => author?.login?.toLocaleLowerCase().includes(authoring)||author?.email?.toLocaleLowerCase().includes(authoring)||author?.name?.toLocaleLowerCase().includes(authoring)).length)
) )
} }
} }

View File

@@ -45,7 +45,7 @@ export default async function({login, data, rest, imports, q, account}, {enabled
...await Promise.allSettled( ...await Promise.allSettled(
commits commits
.flatMap(({payload}) => payload.commits) .flatMap(({payload}) => payload.commits)
.filter(({author}) => data.shared["commits.authoring"].filter(authoring => author?.email?.toLocaleLowerCase().includes(authoring)||author?.name?.toLocaleLowerCase().includes(authoring)).length) .filter(({author}) => data.shared["commits.authoring"].filter(authoring => author?.login?.toLocaleLowerCase().includes(authoring)||author?.email?.toLocaleLowerCase().includes(authoring)||author?.name?.toLocaleLowerCase().includes(authoring)).length)
.map(async commit => (await rest.request(commit)).data.files), .map(async commit => (await rest.request(commit)).data.files),
), ),
] ]

View File

@@ -86,7 +86,7 @@ export async function recent({login, data, imports, rest, account}, {skipped = [
...await Promise.allSettled( ...await Promise.allSettled(
commits commits
.flatMap(({payload}) => payload.commits) .flatMap(({payload}) => payload.commits)
.filter(({author}) => data.shared["commits.authoring"].filter(authoring => author?.email?.toLocaleLowerCase().includes(authoring)||author?.name?.toLocaleLowerCase().includes(authoring)).length) .filter(({author}) => data.shared["commits.authoring"].filter(authoring => author?.login?.toLocaleLowerCase().includes(authoring)||author?.email?.toLocaleLowerCase().includes(authoring)||author?.name?.toLocaleLowerCase().includes(authoring)).length)
.map(commit => commit.url) .map(commit => commit.url)
.map(async commit => (await rest.request(commit)).data), .map(async commit => (await rest.request(commit)).data),
) )