Skip to content

update: 更新js格式化统一prettier配置文件 #1

update: 更新js格式化统一prettier配置文件

update: 更新js格式化统一prettier配置文件 #1

Workflow file for this run

name: Run Prettier on Commit
on:
push:
branches:
- main
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci || npm install
- name: Run Prettier
run: npx prettier --write "**/*.js"
# 可选:提交格式化后的代码
- name: Commit and push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add leetcodeRating_greasyfork.user.js
git commit -m "chore: format with Prettier" || echo "No changes to commit"
git push