Skip to content

Commit

Permalink
fixed CI so I don't have to manually edit markdowns anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
primalbeing committed Feb 7, 2025
1 parent 96b37ed commit 89b519c
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,38 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install ShellCheck
run: sudo apt-get install -y shellcheck

- name: Run ShellCheck on scripts
run: find Scripts Scripts/Setupscripts -type f -name "*.sh" -exec shellcheck {} + || exit 1


markdownlint:
name: Markdown Linter
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: 18

- name: Install markdownlint-cli2
run: npm install -g markdownlint-cli2

- name: Auto-fix Markdown Issues
- name: Run MarkdownLint Auto-Fix
run: markdownlint-cli2 --fix **/*.md

- name: Check for Unfixed Markdown Issues
run: git diff --exit-code || (echo "Markdown issues found after auto-fix. Please review manually." && exit 1)

- name: Commit and Push Fixes (if any)
- name: Commit any changes made by MarkdownLint
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git diff --quiet || (git add . && git commit -m "Auto-fix markdown issues" && git push)
git add .
git diff --staged --quiet || git commit -m "Auto-fix MarkdownLint issues"
- name: Run MarkdownLint again to ensure no remaining errors
run: markdownlint-cli2 **/*.md

0 comments on commit 89b519c

Please sign in to comment.