Skip to content

Commit

Permalink
test summary
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamkrishnar committed Sep 8, 2024
1 parent 2e144e0 commit f980a95
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
22 changes: 11 additions & 11 deletions dist/blog-post-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -13858,10 +13858,10 @@ var runWorkflow = async () => {
if (result.status === "fulfilled") {
core.info(runnerNameArray[index] + " runner succeeded. Post count: " + result.value.length);
summaryTable.push([
{ data: `<a hfef="${runnerNameArray[index]}">${runnerNameArray[index]}</a>`, colspan: "6" },
{ data: ":white_check_mark:" },
{ data: `${result.value.length}` },
{ data: "<code> Runner succeeded </code>", colspan: "6" }
{ header: false, data: `<a href='${runnerNameArray[index]}'>${runnerNameArray[index]}</a>`, colspan: "6" },
{ header: false, data: ":white_check_mark:" },
{ header: false, data: `${result.value.length}` },
{ header: false, data: "<code> Runner succeeded </code>", colspan: "6" }
]);
if (typeof feedNamesList[index] !== void 0 && feedNamesList[index]) {
result.value = result.value.map((item2) => {
Expand Down Expand Up @@ -13950,6 +13950,7 @@ var runWorkflow = async () => {
changedReadmeCount = changedReadmeCount + 1;
}
});
core.summary.addRaw(`### Summary`, true);
if (changedReadmeCount > 0 && !SKIP_COMMITS) {
if (!process.env.TEST_MODE) {
await commitReadme(GITHUB_TOKEN, README_FILE_PATH_LIST).then(() => {
Expand All @@ -13969,17 +13970,16 @@ var runWorkflow = async () => {
true
);
core.info(message.toString());
core.summary.addRaw(`### Summary
${message.toString()}`, true);
core.summary.addTable(summaryTable);
await core.summary.write();
} else {
const noChangeMessage = "No change detected, skipping";
core.info(noChangeMessage);
core.summary.addRaw(`### Summary
${noChangeMessage}`, true);
await core.summary.write();
}
core.summary.addRaw(`Blog posts fetched:`, true);
core.summary.addTable(summaryTable);
core.summary.addRaw(`### Posts written to readme: ${postsArray.length}`, true);
core.summary.addDetails("Debug Info", `\`\`\`json
${JSON.stringify(postsArray, null, 2)}
\`\`\``);
process.exit(jobFailFlag ? 1 : 0);
}
} catch (e) {
Expand Down
18 changes: 9 additions & 9 deletions src/blog-post-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ const runWorkflow = async () => {
// Succeeded
core.info(runnerNameArray[index] + ' runner succeeded. Post count: ' + result.value.length);
summaryTable.push([
{data: `<a hfef="${runnerNameArray[index]}">${runnerNameArray[index]}</a>`, colspan: '6'},
{data: ':white_check_mark:'},
{data: `${result.value.length}`},
{data: '<code> Runner succeeded </code>', colspan: '6'}]);
{header: false, data: `<a href='${runnerNameArray[index]}'>${runnerNameArray[index]}</a>`, colspan: '6'},
{header: false, data: ':white_check_mark:'},
{header: false, data: `${result.value.length}`},
{header: false, data: '<code> Runner succeeded </code>', colspan: '6'}]);
// Adds feed name to the items
if (typeof feedNamesList[index] !== undefined && feedNamesList[index]) {
result.value = result.value.map((item) => {
Expand Down Expand Up @@ -362,6 +362,7 @@ const runWorkflow = async () => {
changedReadmeCount = changedReadmeCount + 1;
}
});
core.summary.addRaw(`### Summary`, true);

if (changedReadmeCount > 0 && !SKIP_COMMITS) {
if (!process.env.TEST_MODE) {
Expand All @@ -380,15 +381,14 @@ const runWorkflow = async () => {
const message = await keepaliveWorkflow.KeepAliveWorkflow(GITHUB_TOKEN, committerUsername, committerEmail,
core.getInput('dummy_commit_message'), 50, true);
core.info(message.toString());
core.summary.addRaw(`### Summary \n ${message.toString()}`, true);
core.summary.addTable(summaryTable);
await core.summary.write();
} else {
const noChangeMessage = 'No change detected, skipping';
core.info(noChangeMessage);
core.summary.addRaw(`### Summary \n ${noChangeMessage}`, true);
await core.summary.write();
}
core.summary.addRaw(`Blog posts fetched:`, true);
core.summary.addTable(summaryTable);
core.summary.addRaw(`### Posts written to readme: ${postsArray.length}`, true);
core.summary.addDetails('Debug Info', `\`\`\`json\n${JSON.stringify(postsArray, null, 2)}\n\`\`\``);
process.exit(jobFailFlag ? 1 : 0);
}
} catch (e) {
Expand Down

0 comments on commit f980a95

Please sign in to comment.