Skip to content

Commit 9895ab4

Browse files
committed
github actions: Verify PR branch isn't on a stale base
Check that the PR branch is up to date with the latest base branch commit, and fail if it isn't.
1 parent 087b394 commit 9895ab4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ jobs:
2525
git fetch "${{ github.event.pull_request.head.repo.clone_url }}" "${{ github.head_ref }}"
2626
echo "HEAD_SHA=$(git rev-parse FETCH_HEAD)" >> "$GITHUB_ENV"
2727
28+
- name: Verify PR branch isn't on stale base
29+
run: |
30+
if ! git merge-base --is-ancestor "${{ github.base_ref }}" "$HEAD_SHA"; then
31+
echo "❌ PR branch must be rebased onto latest base branch commit"
32+
exit 1
33+
fi
34+
2835
- name: Checkout kernel-src-tree-tools
2936
uses: actions/checkout@v4
3037
with:

0 commit comments

Comments
 (0)