Skip to content

Commit 09f31c8

Browse files
committed
use sparse checkout in PR title workflow for improved performance
1 parent 15699e8 commit 09f31c8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/check-pr-title.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ jobs:
1717
github.event.action != 'edited' ||
1818
contains(toJson(github.event.changes), 'title')
1919
steps:
20-
- name: Check out base branch (for script)
20+
- name: Checkout repository (sparse, PR head)
2121
uses: actions/checkout@v5
2222
with:
23-
ref: ${{ github.event.pull_request.base.ref }}
23+
ref: ${{ github.event.pull_request.head.sha }}
24+
fetch-depth: 1
25+
sparse-checkout: |
26+
scripts
27+
sparse-checkout-cone: true
2428
- name: Run PR title check
2529
run: |
2630
python3 scripts/check_pr_title.py "${{ github.event.pull_request.title }}"

0 commit comments

Comments
 (0)