Skip to content

Commit

Permalink
ci: add pre-commit to check commit files
Browse files Browse the repository at this point in the history
  • Loading branch information
zhen.chen authored and AChenQ committed Mar 19, 2021
1 parent 47854ea commit dd8e505
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand Down Expand Up @@ -44,8 +46,14 @@ jobs:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Run pre commit
- name: Run pre commit for all files
run: |
pre-commit run --all-files
git show --format=%B --no-patch > commit-msg
pre-commit run --commit-msg-filename commit-msg --hook-stage commit-msg gitlint
- name: Run pre-commit for commit files
if: always()
run: |
git reset --soft HEAD~1
pre-commit run

0 comments on commit dd8e505

Please sign in to comment.