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

[Feature Request] Use GitHub Annotation output when run in PR, regular output otherwise #22

Open
tyrann0us opened this issue Oct 14, 2022 · 2 comments
Assignees
Labels
on hold Pull requests that update a dependency file

Comments

@tyrann0us
Copy link
Member

I think this is consistent with other workflows, but now that I've used these workflows for a while, I'm seeing that "GitHub Annotation" format works very well on PRs, but very badly on regular commits.

In fact, on regular commits the annotations are printed without an indication of the file/line where the error happened, making it very hard to fix the issues.
This is true for all the tools: PHPCS, Psalm, etc.

The ideal scenario would be using "GitHub Annotation" format when the current event is a PR, and standard console output in the other cases.

Originally posted by @gmazzap in #19 (comment)

@Chrico
Copy link
Member

Chrico commented Dec 6, 2022

I guess we can easily achieve that by adding following to the step:

if: github.event_name == 'pull_request'

github.event_name | string | The name of the event that triggered the workflow run.

@gmazzap
Copy link
Contributor

gmazzap commented Dec 6, 2022

Yes @Chrico the problem is that for Psalm, for example, we have a PSALM_ARGS configuration, which has a default that contains --output-format=github, so to implement this we should have a default with that change based on the github.event_name context.

Or maybe we remove that part from the default and add a separate input AUTO_OUTPUT_FORMAT that when true will append output-format dynamically based on github.event_name and would apply to Psalm and other tools.
This way people can still have custom PSALM_ARGS (or other tools' args) and have a dynamic output format.

@Chrico Chrico removed this from the Leave me alone! milestone Jun 20, 2023
@Chrico Chrico added the on hold Pull requests that update a dependency file label Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

3 participants