Skip to content

Commit 0ccd16a

Browse files
ci(markdownlint): Added GitHub workflow for auto-fixing Markdown lint violations
Signed-off-by: Brijeshthummar02 <brijeshthummar02@gmail.com>
1 parent fa719f7 commit 0ccd16a

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Markdown Lint & Auto-Fix
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
markdown-lint:
10+
name: Lint and Fix Markdown Files
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.head_ref }}
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
20+
- name: Set up Markdownlint
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install -y markdownlint-cli
24+
25+
- name: Run Markdownlint & Auto-Fix
26+
run: |
27+
markdownlint '**/*.md' --fix
28+
29+
- name: Commit Changes (if any)
30+
run: |
31+
git config --global user.name "github-actions[bot]"
32+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
33+
git add .
34+
if git diff --cached --quiet; then
35+
echo "No changes to commit"
36+
else
37+
git commit -m "chore: Auto-fix Markdown lint issues"
38+
git push origin ${{ github.head_ref }}
39+
fi

.markdownlint.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"code-block-style": {
3+
"style": "fenced"
4+
},
5+
"code-fence-style": {
6+
"style": "backtick"
7+
},
8+
"emphasis-style": {
9+
"style": "asterisk"
10+
},
11+
"extended-ascii": {
12+
"ascii-only": true
13+
},
14+
"fenced-code-language": {
15+
"allowed_languages": [
16+
"bash",
17+
"html",
18+
"javascript",
19+
"json",
20+
"markdown",
21+
"text",
22+
"go"
23+
],
24+
"language_only": true
25+
},
26+
"heading-style": {
27+
"style": "atx"
28+
},
29+
"hr-style": {
30+
"style": "---"
31+
},
32+
"line-length": {
33+
"strict": true,
34+
"code_blocks": false
35+
},
36+
"link-image-style": {
37+
"collapsed": false,
38+
"shortcut": false,
39+
"url_inline": false
40+
},
41+
"no-duplicate-heading": {
42+
"siblings_only": true
43+
},
44+
"ol-prefix": {
45+
"style": "ordered"
46+
},
47+
"proper-names": {
48+
"code_blocks": false,
49+
"names": [
50+
"Cake.Markdownlint",
51+
"CommonMark",
52+
"JavaScript",
53+
"Markdown",
54+
"markdown-it",
55+
"markdownlint",
56+
"Node.js",
57+
"Go"
58+
]
59+
},
60+
"reference-links-images": {
61+
"shortcut_syntax": true
62+
},
63+
"strong-style": {
64+
"style": "asterisk"
65+
},
66+
"ul-style": {
67+
"style": "dash"
68+
}
69+
}
70+

0 commit comments

Comments
 (0)