mirror of
https://gitea.redwind.top/Austin/subscription
synced 2024-11-16 23:33:42 +08:00
46 lines
1.0 KiB
YAML
46 lines
1.0 KiB
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
|
|
|
|
- run: pnpm run lint
|
|
|
|
- name: Git commit
|
|
id: commit
|
|
run: |
|
|
git_status=$(git status --porcelain)
|
|
if [ -z "$git_status" ]; then
|
|
exit 0
|
|
fi
|
|
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
|