-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(markdownlint): Added GitHub workflow for auto-fixing Markdown lint…
… violations
- Loading branch information
1 parent
fa719f7
commit d4e62d8
Showing
2 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Markdown Lint & Auto-Fix | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
markdown-lint: | ||
name: Lint and Fix Markdown Files | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Markdownlint | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y markdownlint-cli | ||
- name: Run Markdownlint & Auto-Fix | ||
run: | | ||
markdownlint '**/*.md' --fix | ||
- name: Commit Changes (if any) | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git add . | ||
if git diff --cached --quiet; then | ||
echo "No changes to commit" | ||
else | ||
git commit -m "chore: Auto-fix Markdown lint issues" | ||
git push origin ${{ github.head_ref }} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"code-block-style": { | ||
"style": "fenced" | ||
}, | ||
"code-fence-style": { | ||
"style": "backtick" | ||
}, | ||
"emphasis-style": { | ||
"style": "asterisk" | ||
}, | ||
"extended-ascii": { | ||
"ascii-only": true | ||
}, | ||
"fenced-code-language": { | ||
"allowed_languages": [ | ||
"bash", | ||
"html", | ||
"javascript", | ||
"json", | ||
"markdown", | ||
"text", | ||
"go" | ||
], | ||
"language_only": true | ||
}, | ||
"heading-style": { | ||
"style": "atx" | ||
}, | ||
"hr-style": { | ||
"style": "---" | ||
}, | ||
"line-length": { | ||
"strict": true, | ||
"code_blocks": false | ||
}, | ||
"link-image-style": { | ||
"collapsed": false, | ||
"shortcut": false, | ||
"url_inline": false | ||
}, | ||
"no-duplicate-heading": { | ||
"siblings_only": true | ||
}, | ||
"ol-prefix": { | ||
"style": "ordered" | ||
}, | ||
"proper-names": { | ||
"code_blocks": false, | ||
"names": [ | ||
"Cake.Markdownlint", | ||
"CommonMark", | ||
"JavaScript", | ||
"Markdown", | ||
"markdown-it", | ||
"markdownlint", | ||
"Node.js", | ||
"Go" | ||
] | ||
}, | ||
"reference-links-images": { | ||
"shortcut_syntax": true | ||
}, | ||
"strong-style": { | ||
"style": "asterisk" | ||
}, | ||
"ul-style": { | ||
"style": "dash" | ||
} | ||
} | ||
|