Skip to content

Commit

Permalink
fix(ci): Corrected Markdown file change detection in workflows markdo…
Browse files Browse the repository at this point in the history
…wn-lint.yml

Signed-off-by: Brijeshthummar02 <brijeshthummar02@gmail.com>

:wq
  • Loading branch information
Brijeshthummar02 committed Feb 26, 2025
1 parent fa719f7 commit 38867ef
Showing 2 changed files with 105 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/markdown-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Markdown Lint Check

on:
pull_request:
paths:
- '**/*.md'
push:
branches:
- main

jobs:
markdown-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Check if Markdown Files Changed
id: check_changes
run: |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E '\.md$'; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Install Markdownlint
if: steps.check_changes.outputs.changed == 'true'
run: |
sudo apt-get update
sudo apt-get install -y markdownlint-cli
- name: Run Markdownlint Check
if: steps.check_changes.outputs.changed == 'true'
run: |
markdownlint '**/*.md' --config .markdownlint.json
69 changes: 69 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"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",
"go",
"html",
"javascript",
"json",
"markdown",
"text"
],
"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 38867ef

Please sign in to comment.