@@ -16877,36 +16877,35 @@ function wrapToDiffBlock(message) {
1687716877${message}
1687816878\`\`\``;
1687916879}
16880- function makeConclusion(conclusion, failedByThreshold) {
16881- if (failedByThreshold ) {
16882- return `- ${conclusion}`;
16880+ function makeConclusion(conclusion, failedByThreshold, useDiffBlock ) {
16881+ if (useDiffBlock ) {
16882+ return failedByThreshold ? `- ${conclusion}` : `+ ${conclusion}`;
1688316883 } else {
16884- return `+ ${conclusion}`;
16884+ return failedByThreshold ? `<span style="background-color: #ffe6e6; color: red;"> ${conclusion}</span>` : `<span style="background-color: #e6f4e6; color: green;">${conclusion}</span> `;
1688516885 }
1688616886}
16887- function getCoverageStats(c) {
16887+ function getCoverageStats(c, useDiffBlock ) {
1688816888 if (c.totalLines === 0 && c.totalCoveredLines === 0) {
1688916889 return "";
1689016890 }
1689116891 let stats = "";
1689216892 if (c.totalLines !== 0) {
1689316893 const conclusion = `${c.totalCoverage}% total lines covered`;
16894- stats += `${makeConclusion(conclusion, c.totalCoverage < c.totalCoverageThreshold)}
16894+ stats += `${makeConclusion(conclusion, c.totalCoverage < c.totalCoverageThreshold, useDiffBlock )}
1689516895${c.totalLines} lines analyzed, ${c.totalCoveredLines} lines covered`;
1689616896 }
1689716897 if (c.freshLines !== 0) {
1689816898 const conclusion = `${c.freshCoverage}% fresh lines covered`;
1689916899 stats += `
16900- ${makeConclusion(conclusion, c.freshCoverage < c.freshCoverageThreshold)}
16900+ ${makeConclusion(conclusion, c.freshCoverage < c.freshCoverageThreshold, useDiffBlock )}
1690116901${c.freshLines} lines analyzed, ${c.freshCoveredLines} lines covered`;
1690216902 }
16903- return wrapToDiffBlock(
16904- [
16905- `@@ Code coverage @@`,
16906- `${stats}`,
16907- `# Calculated according to the filters of your coverage tool`
16908- ].join("\n")
16909- );
16903+ const coverageBlock = [
16904+ `@@ Code coverage @@`,
16905+ `${stats}`,
16906+ `# Calculated according to the filters of your coverage tool`
16907+ ].join("\n");
16908+ return useDiffBlock ? wrapToDiffBlock(coverageBlock) : coverageBlock;
1691016909}
1691116910function getLicenseInfo(resultsDir) {
1691216911 let licensesInfo = "";
@@ -79048,7 +79047,7 @@ so that the action will upload the files as the job artifacts:
7904879047 try {
7904979048 const problems = (0, utils_12.parseSarif)(`${resultsDir}/${qodana_12.QODANA_SARIF_NAME}`);
7905079049 const reportUrl = (0, output_12.getReportURL)(resultsDir);
79051- const coverageInfo = (0, output_12.getCoverageStats)((0, qodana_12.getCoverageFromSarif)(`${resultsDir}/${qodana_12.QODANA_SHORT_SARIF_NAME}`));
79050+ const coverageInfo = (0, output_12.getCoverageStats)((0, qodana_12.getCoverageFromSarif)(`${resultsDir}/${qodana_12.QODANA_SHORT_SARIF_NAME}`), false );
7905279051 const licensesInfo = (0, output_12.getLicenseInfo)(resultsDir);
7905379052 const problemsDescriptions = (_a = problems.problemDescriptions) !== null && _a !== void 0 ? _a : [];
7905479053 const toolName = (_b = problems.title.split("found by ")[1]) !== null && _b !== void 0 ? _b : output_12.QODANA_CHECK_NAME;
@@ -79185,10 +79184,10 @@ var require_utils4 = __commonJS({
7918579184 uploadSarif: tl2.getBoolInput("uploadSarif", false),
7918679185 artifactName: tl2.getInput("artifactName", false) || "qodana-report",
7918779186 useNightly: tl2.getBoolInput("useNightly", false),
79188- prMode: tl2.getBoolInput("prMode", true ),
79187+ prMode: tl2.getBoolInput("prMode", false ),
7918979188 postComment: tl2.getBoolInput("postPrComment", false),
7919079189 pushFixes: tl2.getInput("pushFixes", false) || "none",
79191- commitMessage: tl2.getInput("commitMessage", false) || "\u{1F916} Apply quick-fixes by Qodana",
79190+ commitMessage: tl2.getInput("commitMessage", false) || "\u{1F916} Apply quick-fixes by Qodana \n\n[skip ci] ",
7919279191 // Not used by the Azure task
7919379192 additionalCacheKey: "",
7919479193 primaryCacheKey: "",
@@ -79466,11 +79465,9 @@ ${comment_tag_pattern}`;
7946679465 return;
7946779466 }
7946879467 if (mode === qodana_12.BRANCH) {
79469- if (pullRequest) {
79470- const commitToCherryPick = (yield gitOutput(["rev-parse", "HEAD"])).stdout.trim();
79471- yield git(["checkout", currentBranch]);
79472- yield git(["cherry-pick", commitToCherryPick]);
79473- }
79468+ const commitToCherryPick = (yield gitOutput(["rev-parse", "HEAD"])).stdout.trim();
79469+ yield git(["checkout", currentBranch]);
79470+ yield git(["cherry-pick", commitToCherryPick]);
7947479471 yield gitPush(currentBranch);
7947579472 } else if (mode === qodana_12.PULL_REQUEST) {
7947679473 const newBranch = `qodana/quick-fixes-${currentCommit.slice(0, 7)}`;
@@ -79488,9 +79485,7 @@ ${comment_tag_pattern}`;
7948879485 const output = yield gitOutput(["push", "origin", branch], {
7948979486 ignoreReturnCode: true
7949079487 });
79491- if (output.exitCode == 1) {
79492- tl2.warning(`Branch ${branch} already exists. Push of quick-fixes was skipped.`);
79493- } else if (output.exitCode !== 0) {
79488+ if (output.exitCode !== 0) {
7949479489 tl2.warning(`Failed to push branch ${branch}: ${output.stderr}`);
7949579490 }
7949679491 });
0 commit comments