Skip to content

Commit

Permalink
feat: add GH action markdown linting
Browse files Browse the repository at this point in the history
* specification file
  • Loading branch information
jeremyfiel committed Dec 20, 2024
1 parent 155301e commit 3ca1783
Show file tree
Hide file tree
Showing 5 changed files with 490 additions and 10 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/validate-markdown.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: validate-markdown

# Author: @MikeRalphson
# Issue: https://github.com/OAI/OpenAPI-Specification/issues/2130
# Author: @ralfhandl based on work of @MikeRalphson

#
# This workflow validates files in the versions directory matching 1.*.md
# This workflow validates markdown files in the `versions` directory matching *.md
#

# run this on push to any branch and creation of pull-requests
Expand All @@ -16,9 +15,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2 # checkout repo content
- uses: actions/setup-node@v1 # setup Node.js
- uses: actions/checkout@v4 # checkout repo content
with:
node-version: '18.x'
fetch-depth: 0
# - name: use the javascript environment from main
# run: |
# git checkout remotes/origin/main -- package.json package-lock.json .markdownlint.yaml
- uses: actions/setup-node@v4 # setup Node.js
with:
node-version: '20.x'
- name: Validate markdown
run: npx mdv versions/1.*.md
run: npx --yes mdv ./versions/[1-2].*.md
- name: Lint markdown
run: npx --yes markdownlint-cli --config .markdownlint.yaml versions/1.0.[^0].md versions/1.[1-9].*.md versions/2.*.md
12 changes: 12 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Unordered list indentation
MD007:
indent: 2

MD012: false # allow blank lines

MD013:
line_length: 800
tables: false

MD024: false # duplicate headings
MD033: false # inline HTML
Loading

0 comments on commit 3ca1783

Please sign in to comment.