Skip to content

Commit

Permalink
Markdown linting and link check
Browse files Browse the repository at this point in the history
  • Loading branch information
soumeh01 committed Jun 12, 2024
1 parent a323f99 commit f17e2ac
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/markdown-link-check.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"httpHeaders": [
{
"urls": ["https://github.com/", "https://guides.github.com/", "https://help.github.com/", "https://docs.github.com/"],
"headers": {
"Accept-Encoding": "zstd, br, gzip, deflate"
}
}
],
}
18 changes: 18 additions & 0 deletions .github/markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "markdownlint",
"severity": "warning",
"pattern": [
{
"regexp": "^(.*):(\\d+)(:(\\d+))? (MD\\d+\\/[^ ]+) (.*)$",
"file": 1,
"line": 2,
"column": 4,
"code": 5,
"message": 6
}
]
}
]
}
11 changes: 11 additions & 0 deletions .github/markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"default": true,
"MD013": {
"line_length": 120
},
"MD014": false,
"MD029": false,
"MD025": false,
"MD034": false,
"MD041": false
}
47 changes: 47 additions & 0 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: markdown
on:
pull_request:
paths:
- '.github/workflows/markdown.yml'
- '.github/markdownlint.json'
- '.github/markdownlint.jsonc'
- '.github/markdown-link-check.jsonc'
- '**/*.md'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# Declare default permissions as read only.
permissions: read-all

jobs:
markdown-lint:
name: Lint markdown files
runs-on: ubuntu-22.04
steps:
- name: Checkout devtools
uses: actions/checkout@v4

- name: Register markdownlint warning matcher
run: |
echo "::add-matcher::.github/markdownlint.json"
- name: Lint markdown files
uses: avto-dev/markdown-lint@v1
with:
args: '**/*.md'
config: '.github/markdownlint.jsonc'

- name: Remove markdownlint warning matcher
if: always()
run: |
echo "::remove-matcher owner=markdownlint::"
- uses: gaurav-nelson/github-action-markdown-link-check@master
if: always()
with:
use-verbose-mode: 'yes'
check-modified-files-only: 'yes'
base-branch: ${{ github.base_ref }}
config-file: '.github/markdown-link-check.jsonc'

0 comments on commit f17e2ac

Please sign in to comment.