Add the first version of AI-generated docs #19
Workflow file for this run
This file contains hidden or 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: Markdown Lint and Fix | |
on: | |
pull_request: | |
branches: [main] | |
paths: | |
- "comfyui_embedded_docs/docs/**/*.md" | |
jobs: | |
markdown-lint: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
- name: Install markdownlint-cli | |
run: npm install -g markdownlint-cli | |
- name: Get changed markdown files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: | | |
comfyui_embedded_docs/docs/**/*.md | |
- name: Run markdown linting and fix on changed files | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: | | |
# Only process changed markdown files | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
echo "Fixing linting issues for: $file" | |
markdownlint --fix "$file" || true | |
done | |
- name: Check for changes | |
id: verify-changed-files | |
run: | | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "changed=true" >> $GITHUB_OUTPUT | |
echo "Files have been modified by markdownlint" | |
else | |
echo "changed=false" >> $GITHUB_OUTPUT | |
echo "No changes made by markdownlint" | |
fi | |
- name: Commit changes | |
if: steps.verify-changed-files.outputs.changed == 'true' | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add ${{ steps.changed-files.outputs.all_changed_files }} | |
git commit -m "Auto-fix markdown linting issues | |
🤖 Generated with GitHub Actions | |
Co-Authored-By: GitHub Action <action@github.com>" || exit 0 | |
- name: Push changes | |
if: steps.verify-changed-files.outputs.changed == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.head_ref }} |