Merge branch 'master' into feat/allow-disable-annotation
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
const moment = require('moment')
|
||||
const { summary } = require('@actions/core/lib/summary');
|
||||
|
||||
const kicsLogo = "https://user-images.githubusercontent.com/74597872/143567454-f65ad285-00d8-4875-845d-568d2e67d868.png"
|
||||
const severityOrder = ["HIGH", "MEDIUM", "LOW", "INFO", "TRACE"];
|
||||
@ -158,6 +159,12 @@ async function postPRComment(results, repo, prNumber, octokit, commentWithQuerie
|
||||
}
|
||||
}
|
||||
|
||||
async function postJobSummary(results, commentWithQueries = false, excludedColumnsForCommentsWithQueries) {
|
||||
const message = createComment(results, commentWithQueries, excludedColumnsForCommentsWithQueries);
|
||||
await summary.addRaw(message).write()
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
postPRComment
|
||||
postPRComment,
|
||||
postJobSummary
|
||||
};
|
||||
|
@ -49,6 +49,7 @@ async function main() {
|
||||
const githubToken = process.env.INPUT_TOKEN;
|
||||
const disableAnnotations = process.env.INPUT_DISABLE_ANNOTATIONS;
|
||||
const enableComments = process.env.INPUT_ENABLE_COMMENTS;
|
||||
const enableJobsSummary = process.env.INPUT_ENABLE_JOBS_SUMMARY;
|
||||
const commentsWithQueries = process.env.INPUT_COMMENTS_WITH_QUERIES;
|
||||
const excludedColumnsForCommentsWithQueries = process.env.INPUT_EXCLUDED_COLUMNS_FOR_COMMENTS_WITH_QUERIES.split(',');
|
||||
const outputPath = processOutputPath(process.env.INPUT_OUTPUT_PATH);
|
||||
@ -78,6 +79,9 @@ async function main() {
|
||||
if (enableComments.toLocaleLowerCase() === "true") {
|
||||
await commenter.postPRComment(parsedResults, repo, prNumber, octokit, commentsWithQueries.toLocaleLowerCase() === "true", excludedColumnsForCommentsWithQueries);
|
||||
}
|
||||
if (enableJobsSummary.toLocaleLowerCase() === "true") {
|
||||
await commenter.postJobSummary(parsedResults, commentsWithQueries.toLocaleLowerCase() === "true", excludedColumnsForCommentsWithQueries);
|
||||
}
|
||||
|
||||
setWorkflowStatus(exitCode);
|
||||
cleanupOutput(outputPath.resultsJSONFile, outputFormats);
|
||||
|
Reference in New Issue
Block a user