Open jbergstroem opened 1 year ago
Thanks for the suggestion!
I'm personally not convinced by sophisticated output (others may disagree). I just use Taplo in CI like this, i.e. by formatting then diffing using git (which has a nice unsophisticated output). (This is also related to #416 when CI as a use-case for Taplo was mentioned.)
That said, I'm not against this feature if someone is ready to design and implement it and someone else is ready to review it.
I think we could output https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message when GITHUB_CI
is set (or whichever envvar GitHub used).
Was just coming back to suggest that! Probably the best approach.
when GITHUB_CI is set (or whichever envvar GitHub used).
Thinking either GITHUB_ACTIONS
on its own or together with CI
?
https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
Thinking either
GITHUB_ACTIONS
on its own
This should be sufficient.
I'm not entirely sure what the goal of this issue was but I think it would be great if we could turn @jbergstroem's original YAML code into a proper action and publish it.
I've adapted it into an action!
https://github.com/uncenter/setup-taplo
Tested and works on ubuntu-latest
, macos-latest
, and windows-latest
runners.
I'm not entirely sure what the goal of this issue was
The goal is outlined in original post, support for GitHub specific features such as code annotations from CI run.
Taplo as GitHub action is tracked in #326
It's easy enough to get taplo running in CI. Something like this should work (and version can be maintained with a regex in renovatebot):
..that said. The very helpful CLI output is very complicated to parse with a problem matcher.
One way to improve this could be to support a custom output template, similar to actionlint. Another approach could be to have a custom format specifically catering problem matchers (which also could serve as a way get improved editor support).
Edit: For people just arriving, the better approach to this problem is to check if
GITHUB_ACTIONS
is set totrue
in the environment and emit github actions-consumable output.