-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (49 loc) · 1.3 KB
/
Copy pathmd.yml
File metadata and controls
57 lines (49 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Markdown
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
jobs:
changes:
name: Changes Filter
runs-on: ubuntu-24.04
outputs:
mdlint: ${{ steps.filter.outputs.mdlint }}
steps:
- name: Checkout
if: github.event_name != 'pull_request'
uses: actions/checkout@v7
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
mdlint:
- '**.md'
- '.markdownlint-cli2.yaml'
- '.github/workflows/md.yml'
mdlint:
name: Check markdown style
runs-on: ubuntu-24.04
needs: changes
if: ${{ github.event_name == 'workflow_dispatch' || needs.changes.outputs.mdlint == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Lint Markdown files
uses: DavidAnson/markdownlint-cli2-action@v24
gate-mdlint:
name: Markdown gate
runs-on: ubuntu-24.04
needs: [changes, mdlint]
if: always()
steps:
- run: exit 1
if: needs.changes.result != 'success' || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
- run: exit 0