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

Analyzer violations don't show files and lines when run in GitHub Actions (OSOE-875) #43

Closed
Piedone opened this issue Jul 2, 2024 · 3 comments · Fixed by #44
Closed
Assignees
Labels
bug Something isn't working

Comments

@Piedone
Copy link
Member

Piedone commented Jul 2, 2024

See e.g. this run, only the errors are shown:

image

This makes finding and fixing them harder.

The issue might be similar to Lombiq/GitHub-Actions#365: These annotations seem to be broken for good if file is specified (I couldn't find a way to make them work: Lombiq/GitHub-Actions#365 (comment)). So, the solution can be just changing this line to Write-Output "::error::$Message".

Jira issue

@Piedone Piedone added the bug Something isn't working label Jul 2, 2024
@github-actions github-actions bot changed the title Analyzer violations don't show files and lines when run in GitHub Actions Analyzer violations don't show files and lines when run in GitHub Actions (OSOE-875) Jul 2, 2024
@sarahelsaig
Copy link
Member

I'd try something like

Write-Output "::error$(if ($Path) { " title=$Path (Line: $Line; Column: $Column)::$Message" } else { "::$Message" })"

or

Write-Output "::error::$Message $(if ($Path) { "(Path: $Path; Line: $Line; Column: $Column)" })"

because Write-Output "::error::$Message" will only output exactly as much as you already see on the screenshot.

@Piedone
Copy link
Member Author

Piedone commented Jul 3, 2024

Yeah indeed, $Message is not enough, so we should go with your second suggestion. I tried title before for Lombiq/GitHub-Actions#365 and it didn't work either, but we can see if maybe it'll do something here.

@Piedone
Copy link
Member Author

Piedone commented Jul 3, 2024

Yeah, error annotation titles still don't work: https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/actions/runs/9780958471/job/27003865573?pr=804

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants