Skip to content

Commit

Permalink
ci(markdownlint): Added GitHub workflow for auto-fixing Markdown lint…
Browse files Browse the repository at this point in the history
… violations

Signed-off-by: Brijeshthummar02 <[email protected]>
  • Loading branch information
Brijeshthummar02 committed Feb 26, 2025
1 parent fa719f7 commit 0ccd16a
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/markdown-lint.yml
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
70 changes: 70 additions & 0 deletions .markdownlint.json
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"
}
}

0 comments on commit 0ccd16a

Please sign in to comment.