ci: 修复 Node20 已被弃用的警告 #472
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: check_fix_push | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| permissions: write-all | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| if: | | |
| ${{ github.event.head_commit.message!='chore(actions): check_format_lint' }} | |
| steps: | |
| - name: 检出仓库代码 | |
| uses: actions/checkout@v5 | |
| - name: 配置 Node.js 运行环境 | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 25 | |
| package-manager-cache: false | |
| - name: 启用 corepack 并安装 pnpm | |
| run: | | |
| corepack enable | |
| corepack prepare pnpm@latest --activate | |
| - name: 安装项目依赖 | |
| run: pnpm install | |
| - name: 执行项目检查 | |
| run: pnpm run check | |
| - name: 执行代码格式化 | |
| run: pnpm run format | |
| - name: 执行代码静态检查 | |
| run: pnpm run lint | |
| - name: 提交自动修复结果 | |
| id: commit | |
| run: | | |
| git config --local user.email github-actions[bot]@users.noreply.github.com | |
| git config --local user.name github-actions[bot] | |
| git status --porcelain | |
| git --no-pager diff | |
| git commit -a -m "chore(actions): check_format_lint" | |
| continue-on-error: true | |
| - name: 推送修复后的代码 | |
| uses: ad-m/github-push-action@master | |
| if: ${{ steps.commit.outcome == 'success' }} | |
| with: | |
| branch: ${{ github.ref }} |