feat(input): allow to disable annotations

This commit is contained in:
Mickaël VILLERS
2022-11-03 11:31:24 +01:00
parent 40fa83aa10
commit 1df7382b4c
3 changed files with 10 additions and 2 deletions

View File

@@ -47,6 +47,7 @@ async function main() {
// Get ENV variables
const githubToken = process.env.INPUT_TOKEN;
const disableAnnotations = process.env.INPUT_DISABLE_ANNOTATIONS;
const enableComments = process.env.INPUT_ENABLE_COMMENTS;
const commentsWithQueries = process.env.INPUT_COMMENTS_WITH_QUERIES;
const excludedColumnsForCommentsWithQueries = process.env.INPUT_EXCLUDED_COLUMNS_FOR_COMMENTS_WITH_QUERIES.split(',');
@@ -71,12 +72,13 @@ async function main() {
}
const parsedResults = readJSON(outputPath.resultsJSONFile);
if (disableAnnotations.toLocaleLowerCase() === "false") {
annotator.annotateChangesWithResults(parsedResults);
}
if (enableComments.toLocaleLowerCase() === "true") {
await commenter.postPRComment(parsedResults, repo, prNumber, octokit, commentsWithQueries.toLocaleLowerCase() === "true", excludedColumnsForCommentsWithQueries);
}
annotator.annotateChangesWithResults(parsedResults);
setWorkflowStatus(exitCode);
cleanupOutput(outputPath.resultsJSONFile, outputFormats);
} catch (e) {