Skip to content

Commit

Permalink
switch from list to raw
Browse files Browse the repository at this point in the history
  • Loading branch information
dzsquared committed Aug 9, 2024
1 parent c4989f1 commit bd64dc5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ inputs:
required: false
default: false
no-job-summary:
description: 'Do not contribute to a job summary displayed as a job result.'
description: 'Do not provide a job summary from this step.'
required: false
default: false
runs:
Expand Down
2 changes: 1 addition & 1 deletion lib/main.js

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions src/AzureSqlAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,15 @@ export default class AzureSqlAction {
const lines = buildOutput.split(/\r?\n/);
let warnings = lines.filter(line => (line.includes('Build warning') || line.includes('StaticCodeAnalysis warning')));
warnings = [...new Set(warnings)];
let formattedWarnings: string[] = [];

warnings.forEach(warning => {
// remove [project path] from the end of the line
warning = warning.lastIndexOf('[') > 0 ? warning.substring(0, warning.lastIndexOf('[')-1) : warning;

// move the file info from the beginning of the line to the end
warning = '**'+warning.substring(warning.indexOf(':')+2) + '** ' + warning.substring(0, warning.indexOf(':'));
formattedWarnings.push(warning);
warning = '- **'+warning.substring(warning.indexOf(':')+2) + '** ' + warning.substring(0, warning.indexOf(':'));
core.summary.addRaw(warning, true);
});

core.summary.addList(formattedWarnings, false);
core.summary.addRaw('See the full build log for more details.');
} else { // no build warnings
core.summary.addHeading(':white_check_mark: SQL project build succeeded.');
Expand All @@ -152,7 +150,7 @@ export default class AzureSqlAction {
core.summary.addHeading(':x: Build failed.');
}
} catch (err) {
core.warning(`Error parsing build output for job summary: ${err}`);
core.notice(`Error parsing build output for job summary: ${err}`);
}

const dacpacPath = path.join(outputDir, projectName + Constants.dacpacExtension);
Expand Down

0 comments on commit bd64dc5

Please sign in to comment.