这是indexloc提供的服务,不要输入任何密码
Skip to content

clarifying existing live region announcement behavior on creation/ren… #715

clarifying existing live region announcement behavior on creation/ren…

clarifying existing live region announcement behavior on creation/ren… #715

Workflow file for this run

name: Prettier
on:
push:
branches:
- main
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed to compare with origin/main
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install Prettier
run: npm install --global prettier@3.6.0
- name: Get changed files and run Prettier
id: run_prettier
run: |
git fetch origin main
changed_files=$(git diff --name-only origin/main...HEAD | grep -E '\.(js|json|css|html)$' || true)
if [[ -n "$changed_files" ]]; then
echo "$changed_files" | xargs prettier --write --print-width 200
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi
- name: Commit and push changes
if: steps.run_prettier.outputs.changed == 'true'
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Chore: Format files with Prettier"
# Push to the same branch this workflow was triggered from
git push origin HEAD:${{ github.head_ref || github.ref_name }}
- name: No changes to commit
if: steps.run_prettier.outputs.changed == 'false'
run: echo "No changes to commit."