Skip to content

pth ignore + some small format #5

pth ignore + some small format

pth ignore + some small format #5

name: Validate and Fix Markdown
on:
pull_request:
branches:
- main
permissions:
contents: write
jobs:
validate-and-fix-markdown:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install Markdown Linter
run: npm install -g markdownlint-cli
- name: Lint and Fix Markdown files
run: markdownlint '**/*.md' --fix --config .github/.markdownlint.json
- name: Configure Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Commit changes
run: |
git fetch origin
git checkout -b ${{ github.event.pull_request.head.ref }} origin/${{ github.event.pull_request.head.ref }}
git add -A
git commit -m "Fix Markdown syntax issues" || echo "No changes to commit"
git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed"
git push origin HEAD:${{ github.event.pull_request.head.ref }}