Skip to content

Commit 1de32e3

Browse files
Fix PR creation stage
Signed-off-by: Shreeya Patel <spatel@ciq.com>
1 parent a31e328 commit 1de32e3

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

.github/workflows/kernel-build-and-test-x86_64.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ permissions:
55
contents: read
66
actions: read
77
packages: read
8+
pull-requests: write
89

910
jobs:
1011
build:
@@ -199,12 +200,13 @@ jobs:
199200
if: success() || failure()
200201
outputs:
201202
base_branch: ${{ steps.base_branch.outputs.base_branch }}
203+
comparison_status: ${{ steps.comparison.outputs.comparison_status }}
202204

203205
steps:
204206
- name: Checkout kernel source
205207
uses: actions/checkout@v4
206208
with:
207-
fetch-depth: 0
209+
fetch-depth: 0 # Full history needed for reliable merge-base detection
208210

209211
- name: Download current kselftest logs
210212
uses: actions/download-artifact@v4
@@ -359,15 +361,23 @@ jobs:
359361
if: success() || failure()
360362

361363
steps:
362-
- name: Check if all stages passed
364+
- name: Check if tests passed and no regressions
363365
run: |
366+
# Skip PR if any test stage failed
364367
if [ "${{ needs.build.result }}" != "success" ] || \
365368
[ "${{ needs.boot.result }}" != "success" ] || \
366369
[ "${{ needs.test-kselftest.result }}" != "success" ]; then
367370
echo "One or more test stages failed, skipping PR creation"
368371
exit 1
369372
fi
370-
echo "All test stages passed, proceeding with PR creation"
373+
374+
# Skip PR if regression was detected (but allow if comparison was skipped/unavailable)
375+
if [ "${{ needs.compare-results.outputs.comparison_status }}" = "failed" ]; then
376+
echo "Test regression detected, skipping PR creation"
377+
exit 1
378+
fi
379+
380+
echo "All test stages passed and no regressions detected, proceeding with PR creation"
371381
372382
- name: Checkout kernel source
373383
uses: actions/checkout@v4
@@ -495,6 +505,5 @@ jobs:
495505
--base "$BASE_BRANCH" \
496506
--head "${{ github.ref_name }}" \
497507
--title "[${{ github.ref_name }}] ${{ steps.commit_msg.outputs.commit_subject }}" \
498-
--body-file pr_body.md \
499-
--label "automated,tested,ready-for-review"
508+
--body-file pr_body.md
500509
fi

0 commit comments

Comments
 (0)