2023-10-04 01:28:09 +08:00
|
|
|
name: pull_request Check
|
2023-09-04 18:11:22 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
2023-09-20 17:31:56 +08:00
|
|
|
permissions: write-all
|
2023-09-20 17:22:35 +08:00
|
|
|
|
2023-09-04 18:11:22 +08:00
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2023-09-22 20:51:33 +08:00
|
|
|
- uses: actions/setup-node@v3
|
2023-09-20 23:21:36 +08:00
|
|
|
with:
|
2023-09-22 20:51:33 +08:00
|
|
|
node-version: 20
|
2023-09-20 00:12:17 +08:00
|
|
|
|
2023-09-04 18:11:22 +08:00
|
|
|
- uses: pnpm/action-setup@v2
|
|
|
|
|
|
|
|
- run: pnpm install
|
|
|
|
|
|
|
|
- run: pnpm run check
|
2023-09-14 14:40:30 +08:00
|
|
|
|
2023-09-18 20:29:32 +08:00
|
|
|
- run: pnpm run format
|
|
|
|
|
|
|
|
- run: pnpm run lint
|
|
|
|
|
|
|
|
- name: Git commit
|
|
|
|
id: commit
|
|
|
|
run: |
|
|
|
|
git config --local user.email github-actions[bot]@users.noreply.github.com
|
|
|
|
git config --local user.name github-actions[bot]
|
2023-10-04 00:48:59 +08:00
|
|
|
git status --porcelain
|
|
|
|
git --no-pager diff
|
|
|
|
git commit -a -m "chore(actions): check_format_lint"
|
2023-09-20 16:57:34 +08:00
|
|
|
continue-on-error: true
|
|
|
|
|
|
|
|
- name: Git push
|
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
if: ${{ steps.commit.outcome == 'success' }}
|
|
|
|
with:
|
2023-10-04 00:48:59 +08:00
|
|
|
branch: ${{ github.head_ref }}
|