Skip to content

Commit ffc2039

Browse files
committed
Refactor markdownlint workflow
* Fix path to `markdownlint.jsonc` * Add `permissions: contents: read` to limit workflow permissions. * Switch Node version to `lts/*` for automatic long-term support updates. * Upgrade actions to latest releases. * Split the Markdown linting step into separate install and run steps. * Install `markdownlint-cli` with CI-friendly flags (`--no-audit` `--no-fund`). * Pin `markdownlint-cli` to version `0.45.0` to avoid potential build breaks when new versions are released. * Run `markdownlint` with an explicit rather than implicit configuration
1 parent c3afd78 commit ffc2039

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/markdownlint.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
name: Markdownlint
22

3+
permissions:
4+
contents: read
5+
36
on:
47
pull_request:
58
paths:
69
- "**/*.md"
7-
- ".markdownlint.json"
10+
- ".markdownlint.jsonc"
811
- ".github/workflows/markdownlint.yml"
912
- ".github/workflows/markdownlint-problem-matcher.json"
1013
- "!eng/**"
@@ -13,13 +16,15 @@ jobs:
1316
lint:
1417
runs-on: ubuntu-latest
1518
steps:
16-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v5
1720
- name: Use Node.js
18-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v5
1922
with:
20-
node-version: '16'
21-
- name: Run Markdownlint
23+
node-version: 'lts/*'
24+
- name: Install markdownlint-cli
2225
run: |
2326
echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json"
24-
npm i -g markdownlint-cli
25-
markdownlint "**/*.md"
27+
npm install --global --no-audit --no-fund [email protected]
28+
- name: Run markdownlint
29+
run: |
30+
markdownlint --config ./.markdownlint.jsonc '**/*.md'

0 commit comments

Comments
 (0)