File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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 @@ -3,6 +3,7 @@ name: Pre-commit checks
33on :
44 push :
55 pull_request :
6+ workflow_call :
67
78jobs :
89 pre-commit :
2324 python3 -m pip install -r requirements.txt
2425 - name : Run pre-commit checks
2526 run : |
26- git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
27- 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