From 38b6b60393f875b7699024b80fcb9202f214b8f5 Mon Sep 17 00:00:00 2001 From: David Anson Date: Sun, 17 Jan 2021 20:34:17 -0800 Subject: [PATCH] Add example.yml, link, and glob syntax to README.md. --- .github/workflows/example.yml | 12 ++++++++++++ README.md | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/example.yml diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml new file mode 100644 index 0000000..00968d6 --- /dev/null +++ b/.github/workflows/example.yml @@ -0,0 +1,12 @@ +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: DavidAnson/markdownlint-cli2-action@v1 + with: + globs: | + *.md + !test/*.md diff --git a/README.md b/README.md index 2f592f9..65d85c9 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,9 @@ for linting [Markdown][markdown]/[CommonMark][commonmark] files with Glob expression(s) of files to lint (newline-delimited) The default `*.{md,markdown}` lints all Markdown files in the base directory -of a project +of a project. + +For more detail, read about [glob syntax in `markdownlint-cli2`][glob-syntax]. ## Outputs @@ -44,7 +46,12 @@ To lint specific Markdown files in a project: docs/*.md ``` +See [`example.yml`][example-yml] for a simple GitHub workflow that uses +`markdownlint-cli2-action`. + [commonmark]: https://commonmark.org/ +[example-yml]: .github/workflows/example.yml +[glob-syntax]: https://github.com/DavidAnson/markdownlint-cli2#use [markdown]: https://wikipedia.org/wiki/Markdown [markdownlint]: https://github.com/DavidAnson/markdownlint [markdownlint-cli2]: https://github.com/DavidAnson/markdownlint-cli2