GitHub Action: Run hlint
See also rwe/actions-hlint-setup, which will install (and cache) hlint.
Executes hlint
and re-formats the output with a
problem matcher,
so that the hints are displayed as GitHub annotations.
fail-on
(optional, default: never): When to mark the check as failed. One of:never
,status
,warning
,suggestion
, orerror
.path
(required): The single file or directory name, or formatted JSON array containing multiple. Examples:- path: src/
- path: '["src/", "test/"]'
- path: ${{ toJSON(steps.whatever.changed_dirs) }}
(see: docs on toJSON)
hlint-bin
(optional): Thehlint
binary path, if not already inPATH
.
The main purpose of this action currently is just to print out GitHub annotations, but it still provides an output.
ideas
: The generated HLint ideas (warnings, errors, etc.) serialized to JSON.
name: lint
on:
pull_request:
push:
branches:
- master
- 'releases/*'
jobs:
hlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 'Set up HLint'
uses: rwe/actions-hlint-setup@v1
with:
version: '3.1.6'
- name: 'Run HLint'
uses: rwe/actions-hlint-run@v2
with:
path: src/
fail-on: warning