-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (57 loc) · 1.73 KB
/
check-markdown.yml
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
58
59
60
61
62
63
64
65
66
67
name: Check Markdown
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/check-markdown.yml"
- ".markdown-link-check.json"
- "**/.markdownlint*"
- "**.md"
- "**.mdx"
- "**.mkdn"
- "**.mdown"
- "**.markdown"
pull_request:
paths:
- ".github/workflows/check-markdown.yml"
- ".markdown-link-check.json"
- "**/.markdownlint*"
- "**.md"
- "**.mdx"
- "**.mkdn"
- "**.mdown"
- "**.markdown"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to markdownlint.
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize markdownlint-cli problem matcher
uses: xt0rted/markdownlint-problem-matcher@v3
- name: Install markdownlint-cli
run: sudo npm install --global markdownlint-cli
- name: Run markdownlint
run: markdownlint "**/*.md"
links:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Determine whether only modified files should be checked
id: check-modified
if: github.event_name == 'pull_request'
run: |
echo "::set-output name=value::yes"
- name: Check links
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: .markdown-link-check.json
use-quiet-mode: "yes"
check-modified-files-only: ${{ steps.check-modified.outputs.value }}
base-branch: ${{ github.base_ref }}