Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose more rule error output in CI #317

Merged
merged 4 commits into from
Feb 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ See [upgrade notes][1] for helpful information when upgrading from previous vers

What's changed since v1.5.0:

- General improvements:
- Expose more rule error output in CI. [#308](https://github.com/microsoft/PSRule-pipelines/issues/308)
- New features:
- Added support for outputting analysis results as SARIF. [#315](https://github.com/microsoft/PSRule-pipelines/issues/315)
- To use the SARIF output format set the `outputFormat` parameter to `Sarif`.
Expand Down
5 changes: 5 additions & 0 deletions tasks/ps-rule-assertV2/powershell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ try {
Assert-PSRule @invokeParams -InputPath $InputPath;
}
}
catch [PSRule.Pipeline.RuleException] {
Write-Host "`#`#vso[task.logissue type=error]$($_.Exception.Message)";
Write-Host "`#`#vso[task.complete result=Failed;]FAILED";
$Host.SetShouldExit(1);
}
catch {
Write-Host "`#`#vso[task.logissue type=error]$(Get-VstsLocString -Key 'AssertFailed')";
Write-Host "`#`#vso[task.complete result=Failed;]FAILED";
Expand Down