fixed CI so I don't have to manually edit markdowns anymore #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
shellcheck: | |
name: Shell Script Linter | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
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@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install markdownlint-cli2 | |
run: npm install -g markdownlint-cli2 | |
- name: Run MarkdownLint Auto-Fix | |
run: markdownlint-cli2 --fix **/*.md | |
- 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 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 |