|
1 | | -name: Lint Markdown with mardownlint-cli2 |
| 1 | +name: Lint markdown with rumdl |
2 | 2 |
|
3 | 3 | run-name: "${{ github.workflow }} - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}" |
4 | 4 |
|
5 | 5 | on: |
6 | 6 | pull_request: |
7 | 7 | paths: |
8 | 8 | - "**.md" |
| 9 | + - "**/*rumdl.toml" |
9 | 10 |
|
10 | 11 | concurrency: |
11 | 12 | group: ${{ github.workflow }}-${{ github.ref }} |
12 | 13 | cancel-in-progress: true |
13 | 14 |
|
14 | 15 | jobs: |
15 | 16 | lint-markdown: |
16 | | - name: Run markdownlint-cli2 |
| 17 | + name: Run rumdl |
17 | 18 | permissions: |
18 | 19 | contents: read |
19 | 20 | pull-requests: read |
20 | | - runs-on: ubuntu-latest |
| 21 | + runs-on: ubuntu-slim |
21 | 22 | steps: |
22 | 23 | - name: 🛎️ GitHub checkout branch "${{ github.head_ref || github.ref_name }}" |
23 | | - uses: actions/checkout@v5 |
| 24 | + uses: actions/checkout@v6 |
24 | 25 | with: |
25 | 26 | persist-credentials: false |
26 | 27 | - name: 🔍 Get changed files |
|
30 | 31 | filters: | |
31 | 32 | markdown: |
32 | 33 | - added|modified: '**.md' |
| 34 | + rumdlconf: |
| 35 | + - added|modified: '{.,}rumdl.toml' |
| 36 | + - added|modified: '.config/{.,}rumdl.toml' |
33 | 37 | list-files: escape |
34 | | - - name: 🔍 Lint with markdownlint-cli2 |
35 | | - if: steps.filter.outputs.markdown == 'true' |
36 | | - uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e # v20.0.0 |
| 38 | + - name: ⬇️ Install the latest version of uv |
| 39 | + if: steps.filter.outputs.markdown == 'true' || steps.filter.outputs.rumdlconf == 'true' |
| 40 | + uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0 |
37 | 41 | with: |
38 | | - globs: ${{ steps.filter.outputs.markdown_files }} |
| 42 | + cache-dependency-glob: "" |
| 43 | + enable-cache: true |
| 44 | + - name: 🔍 Lint changed markdown files with rumdl |
| 45 | + if: steps.filter.outputs.markdown == 'true' && steps.filter.outputs.rumdlconf == 'false' |
| 46 | + shell: bash |
| 47 | + run: uvx rumdl check ${{ steps.filter.outputs.markdown_files }} |
| 48 | + - name: 🔍 Lint all markdown files with rumdl when ".rumdl.toml" is updated |
| 49 | + if: steps.filter.outputs.rumdlconf == 'true' |
| 50 | + shell: bash |
| 51 | + run: uvx rumdl check . |
0 commit comments