Skip to content

Commit 60cf1d0

Browse files
committed
workflows: pr-checks: add
Provide a workflow for verifying that content added/modified in commits meets basic requirements, i.e. no debug patches with "revertme", "revert me", or "DO NOT MERGE" at the beginning. Also ensure that an "Upstream-Status" line is provided in any carried patches (by running check_patch.py), so that developers understand the patches' purpose. This is based on a combination of the "check_commit_messages" and "check_patches" jobs in wheel_builder's .gitlab-ci.yml script. AI-Generated: Uses Claude Code Sonnet 4.7 Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
1 parent 45407ad commit 60cf1d0

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/pr-checks.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
4+
name: PR verification checks
5+
6+
on:
7+
pull_request:
8+
9+
jobs:
10+
check_commit_messages:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Reject revertme / DO NOT MERGE commits
18+
env:
19+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
20+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
21+
run: |
22+
set -euo pipefail
23+
range="$BASE_SHA..$HEAD_SHA"
24+
if git log --pretty=format:%s "$range" | grep -i -e '^revertme' -e '^revert me'; then
25+
echo "::error::Merge request contains at least a commit starting with a 'revert me' tag. Fix it before merging."
26+
exit 1
27+
fi
28+
if git log --pretty=format:%s "$range" | grep -i -e '^DO NOT MERGE'; then
29+
echo "::error::Merge request contains at least a commit starting with a 'DO NOT MERGE' tag. Review it."
30+
exit 1
31+
fi
32+
33+
check_patches:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
40+
- uses: actions/setup-python@v5
41+
with:
42+
python-version: '3'
43+
44+
- name: Validate Upstream-Status in added/modified patches
45+
env:
46+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
47+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
48+
run: python ci_scripts/check_patch.py "$BASE_SHA" "$HEAD_SHA"

0 commit comments

Comments
 (0)