Skip to content

Commit 094faa8

Browse files
committed
feat: add GH action markdown linting
* specification file * add separate job for markdownlint-cli
1 parent 155301e commit 094faa8

File tree

5 files changed

+499
-12
lines changed

5 files changed

+499
-12
lines changed
Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,37 @@
11
name: validate-markdown
22

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

65
#
7-
# This workflow validates files in the versions directory matching 1.*.md
6+
# This workflow validates markdown files in the `versions` directory matching *.md
87
#
98

109
# run this on push to any branch and creation of pull-requests
1110
on: [push, pull_request]
1211

1312
jobs:
1413
mdv:
15-
1614
runs-on: ubuntu-latest
17-
1815
steps:
19-
- uses: actions/checkout@v2 # checkout repo content
20-
- uses: actions/setup-node@v1 # setup Node.js
16+
- uses: actions/checkout@v4 # checkout repo content
2117
with:
22-
node-version: '18.x'
18+
fetch-depth: 0
19+
# - name: use the javascript environment from main
20+
# run: |
21+
# git checkout remotes/origin/main -- package.json package-lock.json .markdownlint.yaml
22+
- uses: actions/setup-node@v4 # setup Node.js
23+
with:
24+
node-version: '20.x'
2325
- name: Validate markdown
24-
run: npx mdv versions/1.*.md
26+
run: npx --yes mdv ./versions/[1-2].*.md
27+
lint:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
- uses: actions/setup-node@v4
34+
with:
35+
node-version: '20.x'
36+
- name: Markdown Lint
37+
run: npm run format-markdown

.markdownlint.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Unordered list indentation
2+
MD007:
3+
indent: 2
4+
5+
MD012: false # allow blank lines
6+
7+
MD013:
8+
line_length: 800
9+
tables: false
10+
11+
MD024: false # duplicate headings
12+
MD033: false # inline HTML

0 commit comments

Comments
 (0)