Skip to content

Commit

Permalink
feat: adding folder name in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tjsearsz committed Dec 7, 2022
1 parent a0f822c commit 0fc4591
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const commentForMonorepo = (
lcovBaseArrayForMonorepo,
options,
) => {
const { base } = options;
const { base, folder } = options;
const rows = lcovArrayForMonorepo.map((lcovObj) => {
const baseLcov = lcovBaseArrayForMonorepo.find(
(el) => el.packageName === lcovObj.packageName,
Expand Down Expand Up @@ -75,7 +75,9 @@ const commentForMonorepo = (

const html = table(tbody(rows.join("")));

const title = `Coverage after merging into ${b(base)} <p></p>`;
const title = `Coverage for the ${b(folder)} folder after merging into ${b(
base,
)} <p></p>`;

return fragment(title, html);
};
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const main = async () => {
head: context.payload.pull_request.head.ref,
base: context.payload.pull_request.base.ref,
appName,
folder: monorepoBasePath.split("/")[1],
};

const lcov = !monorepoBasePath && (await parse(raw));
Expand Down

0 comments on commit 0fc4591

Please sign in to comment.