From 30d70e6c828955bf10553b003aa420444c462ccf Mon Sep 17 00:00:00 2001 From: iamtodor Date: Fri, 1 Jul 2022 20:18:55 +0200 Subject: [PATCH 1/3] add markdown linter --- .github/workflows/markdown_lint.yml | 2 +- .github/workflows/markdown_linter_checks.yml | 27 ++++++++++++++++++++ .github/workflows/markdown_linter_rules.rb | 16 ++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/markdown_linter_checks.yml create mode 100644 .github/workflows/markdown_linter_rules.rb diff --git a/.github/workflows/markdown_lint.yml b/.github/workflows/markdown_lint.yml index 57394e0d..2fbc480b 100644 --- a/.github/workflows/markdown_lint.yml +++ b/.github/workflows/markdown_lint.yml @@ -16,7 +16,7 @@ jobs: markdown-link-check: runs-on: ubuntu-latest steps: - - name: Checkout + - name: checkout uses: actions/checkout@v3 with: submodules: recursive diff --git a/.github/workflows/markdown_linter_checks.yml b/.github/workflows/markdown_linter_checks.yml new file mode 100644 index 00000000..6b9075bf --- /dev/null +++ b/.github/workflows/markdown_linter_checks.yml @@ -0,0 +1,27 @@ +name: markdown-linter + +on: + push: + branches: + - master + - main + paths: + - "**.md" + - ".github/workflows/markdown_linter_rules.yml" + - ".github/workflows/markdown_linter_checks.yml" +permissions: + contents: read +jobs: + markdown-lint: + name: Lint repository + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.1" + - name: Install mdl + run: gem install mdl + - name: Run markdown-linter + run: mdl -s .github/workflows/markdown_linter_rules.rb docs/. \ No newline at end of file diff --git a/.github/workflows/markdown_linter_rules.rb b/.github/workflows/markdown_linter_rules.rb new file mode 100644 index 00000000..625aaeeb --- /dev/null +++ b/.github/workflows/markdown_linter_rules.rb @@ -0,0 +1,16 @@ +all +exclude_rule 'MD001' +exclude_rule 'MD004' +exclude_rule 'MD007' +exclude_rule 'MD009' +exclude_rule 'MD012' +exclude_rule 'MD013' +exclude_rule 'MD022' +exclude_rule 'MD024' +exclude_rule 'MD026' +exclude_rule 'MD029' +exclude_rule 'MD032' +exclude_rule 'MD033' +exclude_rule 'MD034' +exclude_rule 'MD036' +# rule 'MD029', :style => 'ordered' \ No newline at end of file From 2b1b1dd86657ca4189621ff826569a0ce205e950 Mon Sep 17 00:00:00 2001 From: iamtodor Date: Fri, 1 Jul 2022 20:21:59 +0200 Subject: [PATCH 2/3] fix when run --- .github/workflows/markdown_linter_checks.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/markdown_linter_checks.yml b/.github/workflows/markdown_linter_checks.yml index 6b9075bf..fb5472ec 100644 --- a/.github/workflows/markdown_linter_checks.yml +++ b/.github/workflows/markdown_linter_checks.yml @@ -2,9 +2,11 @@ name: markdown-linter on: push: - branches: - - master - - main + paths: + - "**.md" + - ".github/workflows/markdown_linter_rules.yml" + - ".github/workflows/markdown_linter_checks.yml" + pull_request: paths: - "**.md" - ".github/workflows/markdown_linter_rules.yml" From 377ad902f49fc6c0b90740ec817e2801af3bd89d Mon Sep 17 00:00:00 2001 From: iamtodor Date: Fri, 1 Jul 2022 20:25:25 +0200 Subject: [PATCH 3/3] rename check --- .../workflows/{markdown_lint.yml => markdown_link_check.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{markdown_lint.yml => markdown_link_check.yml} (85%) diff --git a/.github/workflows/markdown_lint.yml b/.github/workflows/markdown_link_check.yml similarity index 85% rename from .github/workflows/markdown_lint.yml rename to .github/workflows/markdown_link_check.yml index 2fbc480b..070b41d4 100644 --- a/.github/workflows/markdown_lint.yml +++ b/.github/workflows/markdown_link_check.yml @@ -4,12 +4,12 @@ on: push: paths: - "**.md" - - ".github/workflows/markdown_lint.yml" + - ".github/workflows/markdown_link_check.yml" - ".github/workflows/markdown_link_check_config.json" pull_request: paths: - "**.md" - - ".github/workflows/markdown_lint.yml" + - ".github/workflows/markdown_link_check.yml" - ".github/workflows/markdown_link_check_config.json" jobs: