Update global-rules.md #90
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
# This workflow ensures markdown files follow our style guide | |
# Logic: | |
# 1. Runs on every push and PR | |
# 2. Uses markdownlint-cli2 (same as local) | |
# 3. Attempts to auto-fix issues and commits them | |
# 4. If fixes aren't possible, fails the check | |
# 5. Also runs spell checking and code block validation | |
name: Markdown Lint | |
on: | |
push: | |
paths: | |
- '**/*.md' | |
pull_request: | |
paths: | |
- '**/*.md' | |
jobs: | |
markdownlint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check markdown | |
uses: DavidAnson/markdownlint-cli2-action@v13 | |
with: | |
globs: '**/*.md' | |
config: '.markdownlint-cli2.jsonc' # Use our configuration file | |
env: | |
GITHUB_WORKSPACE: /Users/ismar/repos/awesome-windsurf # Set the workspace path | |
fix-and-check: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' # Only run on pull requests | |
needs: markdownlint # Run after basic linting passes | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
- run: npm ci | |
- name: Fix markdown | |
run: npm run fix:md | |
- name: Check spelling | |
run: npm run spell-check | |
- name: Check code blocks | |
run: npm run check-codeblocks | |
- name: Commit fixes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "fix: auto-fix markdown formatting" | |
file_pattern: "**/*.md" |