mirror of
https://gitea.redwind.top/Austin/subscription
synced 2024-11-16 15:52:27 +08:00
38 lines
783 B
YAML
38 lines
783 B
YAML
name: Check
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ !startsWith(github.event.head_commit.message, 'chore(main):') && !contains(github.event.head_commit.message, 'release') }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: volta-cli/action@v3
|
|
|
|
- uses: pnpm/action-setup@v2
|
|
|
|
- run: pnpm install
|
|
|
|
- run: pnpm run check
|
|
|
|
- run: |
|
|
pnpm run format
|
|
pnpm run lint
|
|
git status --porcelain
|
|
git_status=$(git status --porcelain)
|
|
if [ -n "$git_status" ]; then
|
|
git --no-pager diff
|
|
echo "提交代码风格不合规"
|
|
exit 1
|
|
fi
|