If Bicep returns a non-0 exit code (e.g. there are any build errors), not propagating output #28259
Labels
Auto-Assign
Auto assign by bot
Azure Deployments
az deployment/bicep/stack/deployment-scripts/ts/group export
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
Service Attention
This issue is responsible by Azure service team.
Describe the bug
@anthony-c-martin of the Bicep team asked me to raise this issue here:
Azure/bicep#11960 (comment)
This issue being experienced is that when
az bicep lint
fails (returns a non-0 exit code) no output is produced.Related command
Consider the following command that lints a Bicep module and outputs to a
bicep.sarif
file:az bicep lint --file ./infra/main.bicep --diagnostics-format sarif > bicep.sarif
This works well when it comes to lints that exit with 0 (only warnings). Output is produced, this is as desired. However if the linting fails / exits with non-0 then output is not produced. This is a problem as users are not advised as to the problem.
Errors
Haha - it's actually the lack of errors that is the issue!
Issue script & Debug output
Running in the context of GitHub Actions:
With a
bicepconfig.json
that looks like this:And in the
main.bicep
file an unused variable:This produces no output. See here: https://github.com/johnnyreilly/blog.johnnyreilly.com/actions/runs/7684802835/job/20941714974?pr=817
Expected behavior
By contrast compare with https://github.com/johnnyreilly/blog.johnnyreilly.com/actions/runs/7684722135/job/20941552998 where there was a 0 return code as we dialled the lint rule down from an
error
to awarning
:Regardless of whether exiting with 0 or non-0,
az bicep lint
should produce output.Environment Summary
Additional context
Read more from the thread here: Azure/bicep#11960 - there's a bunch of things in there
The text was updated successfully, but these errors were encountered: