Skip to content

Commit

Permalink
Merge branch 'mahf708/docs/markdownlinter' (PR E3SM-Project#6342)
Browse files Browse the repository at this point in the history
Adds a markdown linter on new files in PRs to ensure they conform with some
linting rules (can modify these later if needed).

[BFB]
  • Loading branch information
rljacob authored Apr 17, 2024
2 parents e1e7058 + 558eb58 commit de85394
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/e3sm-gh-md-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: markdown

# if .md files are touched in a PR, lint them!

on:
pull_request:
branches: ["master"]
paths:
- '**/*.md'

jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: tj-actions/changed-files@v44
id: changed-files
with:
files: '**/*.md'
separator: ","
- uses: DavidAnson/markdownlint-cli2-action@v16
if: steps.changed-files.outputs.any_changed == 'true'
with:
config: 'docs/.markdownlint.json'
globs: ${{ steps.changed-files.outputs.all_changed_files }}
separator: ","
3 changes: 3 additions & 0 deletions docs/.markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"line-length": false
}

0 comments on commit de85394

Please sign in to comment.