File tree Expand file tree Collapse file tree 3 files changed +10
-43
lines changed Expand file tree Collapse file tree 3 files changed +10
-43
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -16,19 +16,19 @@ concurrency:
1616 !startsWith(github.ref, 'refs/heads/gh-readonly-queue') }}
1717
1818jobs :
19- cpp-lint :
20- uses : ./.github/workflows/cpp-lint .yml
19+ pre-commit :
20+ uses : ./.github/workflows/pre-commit .yml
2121 ubuntu :
2222 needs :
23- - cpp-lint
23+ - pre-commit
2424 uses : ./.github/workflows/ubuntu.yml
2525 mac :
2626 needs :
27- - cpp-lint
27+ - pre-commit
2828 uses : ./.github/workflows/mac.yml
2929 windows :
3030 needs :
31- - cpp-lint
31+ - pre-commit
3232 uses : ./.github/workflows/windows.yml
3333 perf :
3434 needs :
Original file line number Diff line number Diff line change 11name : Pre-commit checks
22
33on :
4+ push :
45 pull_request :
5- paths-ignore :
6- - ' docs/**'
7- - ' *.md'
8- - ' *.rst'
9- - ' *.txt'
10- - ' LICENSE'
6+ workflow_call :
117
128jobs :
139 pre-commit :
2824 python3 -m pip install -r requirements.txt
2925 - name : Run pre-commit checks
3026 run : |
31- git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
32- pre-commit run --from-ref ${{ github.base_ref }} --to-ref HEAD
27+ FROM_REF="${{ github.base_ref || 'HEAD~1' }}"
28+ git fetch origin $FROM_REF:$FROM_REF || true
29+ pre-commit run --from-ref $FROM_REF --to-ref HEAD
You can’t perform that action at this time.
0 commit comments