Skip to content

测试

测试 #22

Workflow file for this run

# .github/workflows/build.yml
name: build_script_and_check_format
on:
push:
branches: ['main']
paths:
- 'src/**'
- 'Script/*'
- 'build.js'
- '.prettierrc*'
workflow_dispatch:
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v6
- name: setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
- name: install prettier
run: npm install -g prettier
- name: format files
run: |
prettier src/**/*.js Script/*.js build.js --write
- name: run build script
run: node build.js
- name: commit and push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git diff --cached --quiet || (
git commit -m "build: 更新脚本"
git push
)