Skip to content

Commit

Permalink
Fix CI: Auto-fix and commit Markdown issues
Browse files Browse the repository at this point in the history
  • Loading branch information
primalbeing committed Feb 7, 2025
1 parent 89b519c commit 2408263
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
persist-credentials: true

- name: Set up Node.js
uses: actions/setup-node@v3
Expand All @@ -40,12 +42,19 @@ jobs:
- name: Run MarkdownLint Auto-Fix
run: markdownlint-cli2 --fix **/*.md

- name: Commit any changes made by MarkdownLint
- name: Check for changes
id: git-diff
run: |
git diff --exit-code || echo "changes_detected=true" >> $GITHUB_ENV
- name: Commit and Push Fixes
if: env.changes_detected == 'true'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff --staged --quiet || git commit -m "Auto-fix MarkdownLint issues"
git commit -m "Auto-fix MarkdownLint issues"
git push
- name: Run MarkdownLint again to ensure no remaining errors
- name: Run MarkdownLint Again to Ensure No Errors
run: markdownlint-cli2 **/*.md

0 comments on commit 2408263

Please sign in to comment.