Skip to content

Commit 692dd27

Browse files
committed
github actions: Allow fork checkout for commit validation
Since we have external contributors we need process each of the commits for faster reviews, validation that header information is correct and to check the state of our tickets so that is actually tracked correctly internally, on behalf of some external contributors.
1 parent c4f6b9e commit 692dd27

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/validate-kernel-commits.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,22 @@ jobs:
1414
timeout-minutes: 120
1515

1616
steps:
17-
- name: Checkout PR branch
17+
- name: Checkout base branch
1818
uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
21-
ref: ${{ github.head_ref }}
21+
ref: ${{ github.event.pull_request.base.ref }}
2222

23-
- name: Checkout base branch
23+
- name: Add and checkout PR branch
2424
run: |
25-
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
25+
if [ "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.event.pull_request.base.repo.full_name }}" ]; then
26+
git fetch origin ${{ github.event.pull_request.head.ref }}
27+
git checkout ${{ github.event.pull_request.head.ref }}
28+
else
29+
git remote add fork-pr https://github.com/${{ github.event.pull_request.head.repo.full_name }}
30+
git fetch fork-pr ${{ github.event.pull_request.head.ref }}
31+
git checkout ${{ github.event.pull_request.head.ref }}
32+
fi
2633
2734
- name: Checkout kernel-src-tree-tools
2835
uses: actions/checkout@v4

0 commit comments

Comments
 (0)