Skip to content
Merged
Prev Previous commit
Next Next commit
add some output logging
  • Loading branch information
scbedd committed Jul 30, 2025
commit 5d1fcddd475fa08394cd7e13ae83e06a7f4e9291
66 changes: 45 additions & 21 deletions .github/workflows/src/summarize-checks/summarize-checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,28 @@ export default async function summarizeChecks({ github, context, core }) {
);
}

/**
* @param {typeof import("@actions/core")} core
* @param {CheckRunData[]} requiredCheckRuns
* @param {CheckRunData[]} fyiCheckRuns
*/
export function outputRunDetails(core, requiredCheckRuns, fyiCheckRuns) {
core.info(
`Observed ${requiredCheckRuns.length} required check runs ${requiredCheckRuns.length > 0 ? ":" : "."}`,
);
requiredCheckRuns.forEach((x) => {
core.info(
`Required check "${x.name}" with status "${x.status}" and conclusion "${x.conclusion}"`,
);
});
core.info(
`Observed ${fyiCheckRuns.length} FYI check runs ${fyiCheckRuns.length > 0 ? ":" : "."}`,
);
fyiCheckRuns.forEach((x) => {
core.info(`FYI check "${x.name}" with status "${x.status}" and conclusion "${x.conclusion}"`);
});
}

/**
* @param {import('@actions/github-script').AsyncFunctionArguments['github']} github
* @param {import('@actions/github').context } context
Expand Down Expand Up @@ -346,6 +368,8 @@ export async function summarizeChecksImpl(
EXCLUDED_CHECK_NAMES,
);

outputRunDetails(core, requiredCheckRuns, fyiCheckRuns);

let labelContext = await updateLabels(labelNames, impactAssessment);

core.info(
Expand All @@ -355,27 +379,27 @@ export async function summarizeChecksImpl(
`Adding labels [${Array.from(labelContext.toAdd).join(", ")}]`,
);

// for (const label of labelContext.toRemove) {
// core.info(`Removing label: ${label} from ${owner}/${repo}#${issue_number}.`);
// await github.rest.issues.removeLabel({
// owner: owner,
// repo: repo,
// issue_number: issue_number,
// name: label,
// });
// }

// if (labelContext.toAdd.size > 0) {
// core.info(
// `Adding labels: ${Array.from(labelContext.toAdd).join(", ")} to ${owner}/${repo}#${issue_number}.`,
// );
// await github.rest.issues.addLabels({
// owner: owner,
// repo: repo,
// issue_number: issue_number,
// labels: Array.from(labelContext.toAdd),
// });
// }
for (const label of labelContext.toRemove) {
core.info(`Removing label: ${label} from ${owner}/${repo}#${issue_number}.`);
// await github.rest.issues.removeLabel({
// owner: owner,
// repo: repo,
// issue_number: issue_number,
// name: label,
// });
}

if (labelContext.toAdd.size > 0) {
core.info(
`Adding labels: ${Array.from(labelContext.toAdd).join(", ")} to ${owner}/${repo}#${issue_number}.`,
);
// await github.rest.issues.addLabels({
// owner: owner,
// repo: repo,
// issue_number: issue_number,
// labels: Array.from(labelContext.toAdd),
// });
}

// adjust labelNames based on labelsToAdd/labelsToRemove
labelNames = labelNames.filter((name) => !labelContext.toRemove.has(name));
Expand Down