An easy-to-configure GitHub action for static linting of your repo.
Given a list of lint configurations and include/exclude file path globs, the action will create check run annotations on any failing patterns (warning or error configured).
This action currently only supports the pull_request
event.
A file path to the YAML configuration file
This action produces no outputs.
See .github/regex-lint.yml
for an example configuration.
name
(required): A human-friendly name for this lint configurationpattern
(required): A Javascript regular expression patterndocumentation
(optional): An additional description to put on the annotationseverity
(optional, default =error
): One of (warning
,error
) -- if set toerror
, a failing lint will cause the action's check to failoverridden-include-paths
(optional, default = no overrides): Override theglobal-include-paths
for this specific lint patternoverridden-exclude-paths
(optional, default = no overrides): Override theglobal-exclude-paths
for this specific lint pattern
NOTE: A file that matches an include path and an exclude path will be excluded. This also applies to overridden paths.
A list of file path globs. The list of linted pull request files (minus those removed in the PR) will be checked to be included in at least one of the specified globs.
NOTE: A file that matches an include path and an exclude path will be excluded.
A list of file path globs. The list of linted pull request files (minus those removed in the PR) will be checked to be not excluded in all of the specified globs.
Hello!
This should cause an error as it contains the word hello which violates one of the test rules. See the last PR as an example of how the annotations appear.