carpentries / sandpaper

User Interface for The Carpentries Workbench
https://carpentries.github.io/sandpaper
Other
42 stars 27 forks source link

GitHub Actions: Translate warnings and errors to workflow commands #50

Closed zkamvar closed 3 months ago

zkamvar commented 3 years ago

https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message

I've found it helpful in pull requests when warnings and errors label the lines where an error is found. This is achieved in GitHub Actions via workflow commands that are strings output to stdout that start with ::.

For example, this warning was generated from this workflow command:

::warning file=episodes/01-introduction.Rmd,line=10,col=5::This is a warning
ErinBecker commented 3 months ago

This has been implemented, as demonstrated by the output below showing an error message for image missing alt text.

── Validating Fenced Divs ──────────────────────────────────────────────────────
── Validating Internal Links and Images ────────────────────────────────────────
! There were errors in 1/123 images
◌ Images need alt-text <https://webaim.org/techniques/hypertext/link_text#alt_link>