2023-09-04 18:11:22 +08:00
|
|
|
name: Check
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- '**'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
runs-on: ubuntu-latest
|
2023-09-04 20:15:24 +08:00
|
|
|
if: ${{ !startsWith(github.event.head_commit.message, 'chore(main):') && !contains(github.event.head_commit.message, 'release') }}
|
2023-09-04 18:11:22 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: volta-cli/action@v3
|
|
|
|
|
2023-09-20 00:12:17 +08:00
|
|
|
- run: node -v
|
|
|
|
|
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: |
|
2023-09-14 14:40:30 +08:00
|
|
|
git_status=$(git status --porcelain)
|
2023-09-18 20:29:32 +08:00
|
|
|
if [ -z "$git_status" ]; then
|
|
|
|
exit 0
|
2023-09-14 14:40:30 +08:00
|
|
|
fi
|
2023-09-18 20:29:32 +08:00
|
|
|
git config --local user.email github-actions[bot]@users.noreply.github.com
|
|
|
|
git config --local user.name github-actions[bot]
|
|
|
|
git config --global core.autocrlf true
|
|
|
|
git config --global core.safecrlf false
|
|
|
|
git status
|
|
|
|
git add .
|
|
|
|
git commit -m "chore: format+lint" -a
|