Skip to content

Commit 28a10dd

Browse files
committed
Refactor markdownlint workflow
* 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 28a10dd

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/markdownlint.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Markdownlint
22

3+
permissions:
4+
contents: read
5+
36
on:
47
pull_request:
58
paths:
@@ -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 markdownlint-cli@0.45.0
28+
- name: Run markdownlint
29+
run: |
30+
markdownlint --config ./.markdownlint.jsonc '**/*.md'

0 commit comments

Comments
 (0)