===============================
== Andrew Imeson's Microblog ==
===============================
My microblog about anything

GitHub Actions Annotations

GitHub Linting Continuous Integration

You can annotate files in GitHub Actions by echoing a special format to STDOUT or STDERR. I submitted a PR to add that functionality to yamllint a while ago, but I can never remember where the docs are for the GitHub feature. They are under Workflow commands for GitHub Actions

::warning file={name},line={line},col={col}::{message}
::warning file=app.js,line=1,col=5::Missing semicolon

I want to add this feature to more tools, but I think it’s kind of a waste to have to implement it in each tool. Someone should write a shell script that takes GCC-style linter output (which many tools, like ShellCheck, emit) and convert it to the GitHub Actions Annotations format.

Maybe I’ll take a stab at it sometime. Make it like so:

shellcheck 2>&1 | ghannotate