chore(actions): check_format_lint

This commit is contained in:
lisonge
2023-09-20 16:57:34 +08:00
parent 288ac4af2b
commit 22c1b5ed6d

View File

@@ -11,7 +11,7 @@ on:
jobs: jobs:
check: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ !startsWith(github.event.head_commit.message, 'chore(main):') && !contains(github.event.head_commit.message, 'release') }} if: ${{ !startsWith(github.event.head_commit.message, 'chore(main):') && !contains(github.event.head_commit.message, 'release') && !contains(github.event.head_commit.message, 'check_format_lint') }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
@@ -34,14 +34,19 @@ jobs:
- name: Git commit - name: Git commit
id: commit id: commit
run: | run: |
git_status=$(git status --porcelain) 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.email github-actions[bot]@users.noreply.github.com
git config --local user.name github-actions[bot] git config --local user.name github-actions[bot]
git config --global core.autocrlf true git config --global core.autocrlf true
git config --global core.safecrlf false git config --global core.safecrlf false
git status git status
git add . git add .
git commit -m "chore: format+lint" -a git commit -m "chore(actions): check_format_lint" -a
continue-on-error: true
- name: Git push
uses: ad-m/github-push-action@master
if: ${{ steps.commit.outcome == 'success' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}