From e1b557ea9a5d3819760646d39d7e77e5249650e1 Mon Sep 17 00:00:00 2001 From: "Allen D. Householder" Date: Fri, 27 Oct 2023 09:55:10 -0400 Subject: [PATCH] Create Markdown Lint actions (#17) * Create lint_md_changes.yml from https://github.com/DavidAnson/markdownlint-cli2-action * Update lint_md_changes.yml * Create lint_md_all.yml (#18) * Create lint_md_all.yml * Update lint_md_all.yml --- .github/workflows/lint_md_all.yml | 15 +++++++++++++++ .github/workflows/lint_md_changes.yml | 20 ++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/lint_md_all.yml create mode 100644 .github/workflows/lint_md_changes.yml diff --git a/.github/workflows/lint_md_all.yml b/.github/workflows/lint_md_all.yml new file mode 100644 index 00000000..f59ee4f5 --- /dev/null +++ b/.github/workflows/lint_md_all.yml @@ -0,0 +1,15 @@ +name: "Lint Markdown (all)" + +on: + workflow_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: DavidAnson/markdownlint-cli2-action@v13 + with: + globs: | + *.md + !test/*.md diff --git a/.github/workflows/lint_md_changes.yml b/.github/workflows/lint_md_changes.yml new file mode 100644 index 00000000..5c85b77d --- /dev/null +++ b/.github/workflows/lint_md_changes.yml @@ -0,0 +1,20 @@ +name: "Lint Markdown (Changes)" +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: tj-actions/changed-files@v40 + id: changed-files + with: + files: '**/*.md' + separator: "," + - uses: DavidAnson/markdownlint-cli2-action@v13 + if: steps.changed-files.outputs.any_changed == 'true' + with: + globs: ${{ steps.changed-files.outputs.all_changed_files }} + separator: ","