Skip to content

Commit 85dc30f

Browse files
[housekeeping] GH Action markdown table formatting (discord#6376)
* Add markdown table format check to GH Actions * Check in all docs folders for .md and .mdx * Support globstar in bash command * chore(actions): install markdown-table-formatter via package.json (#2) adds the possibility to run it locally (check & fix) * Move docs format check into its own workflow --------- Co-authored-by: Lala Sabathil <[email protected]>
1 parent 9078f03 commit 85dc30f

File tree

4 files changed

+190
-2
lines changed

4 files changed

+190
-2
lines changed

.github/workflows/docs.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Verify Docs Formatting
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
markdown_tables:
10+
name: Check Markdown Tables
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Install Node v16
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 16
20+
cache: npm
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Check Markdown Tables
26+
run: |
27+
shopt -s globstar
28+
npx markdown-table-formatter docs/**/*.{md,mdx} --check
29+
shell: bash

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ jobs:
4545
run: npm run build
4646

4747
- name: Run Link Checks
48-
run: npm run test:links
48+
run: npm run test:links

package-lock.json

Lines changed: 156 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"build": "tsc --build",
2121
"lint": "eslint ci",
2222
"lint:fix": "eslint ci --fix",
23-
"test:links": "node dist/ci/checkLinks.js"
23+
"test:links": "node dist/ci/checkLinks.js",
24+
"test:tables": "npx markdown-table-formatter docs/**/*.{md,mdx} --check",
25+
"fix:tables": "npx markdown-table-formatter docs/**/*.{md,mdx}"
2426
},
2527
"devDependencies": {
2628
"@actions/core": "^1.9.1",
@@ -32,6 +34,7 @@
3234
"eslint-config-marine": "^9.0.6",
3335
"eslint-config-prettier": "^8.3.0",
3436
"eslint-plugin-prettier": "^4.0.0",
37+
"markdown-table-formatter": "^1.4.0",
3538
"prettier": "^2.4.1",
3639
"typescript": "^4.4.3"
3740
}

0 commit comments

Comments
 (0)