Skip to content

Commit f8718c0

Browse files
committed
add interdiff ga
1 parent 7a7f1c0 commit f8718c0

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/upstream-commit-check.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,26 @@ jobs:
3535
with:
3636
python-version: '3.x'
3737

38+
- name: Install build dependencies for patchutils
39+
run: |
40+
sudo apt-get update
41+
sudo apt-get install -y build-essential autoconf automake libtool gnulib
42+
43+
- name: Clone and build custom patchutils
44+
run: |
45+
git clone https://github.com/kerneltoast/patchutils
46+
cd patchutils
47+
./bootstrap
48+
./configure
49+
make -j$(nproc)
50+
51+
- name: Download run_interdiff.py
52+
run: |
53+
curl -sL \
54+
https://raw.githubusercontent.com/ctrliq/kernel-src-tree-tools/hackathon-cve-check/run_interdiff.py \
55+
-o run_interdiff.py
56+
chmod +x run_interdiff.py
57+
3858
- name: Run upstream fixes check
3959
id: checkkernel
4060
run: |
@@ -44,6 +64,15 @@ jobs:
4464
echo "has_findings=true" >> $GITHUB_OUTPUT
4565
fi
4666
67+
- name: Run interdiff check
68+
id: interdiff
69+
run: |
70+
python3 run_interdiff.py --repo . --pr_branch "${{ github.head_ref }}" --base_branch "${{ github.base_ref }}" --markdown --interdiff ./patchutils/src/interdiff | tee interdiff_result.txt
71+
# Save non-empty results for PR comment
72+
if grep -q -v "All backported commits match their upstream counterparts." interdiff_result.txt; then
73+
echo "has_differences=true" >> $GITHUB_OUTPUT
74+
fi
75+
4776
- name: Comment on PR if issues found
4877
if: steps.checkkernel.outputs.has_findings == 'true'
4978
env:
@@ -52,3 +81,12 @@ jobs:
5281
gh pr comment ${{ github.event.pull_request.number }} \
5382
--body "$(cat result.txt)" \
5483
--repo ${{ github.repository }}
84+
85+
- name: Comment on PR if interdiff differences found
86+
if: steps.interdiff.outputs.has_differences == 'true'
87+
env:
88+
GH_TOKEN: ${{ github.token }}
89+
run: |
90+
gh pr comment ${{ github.event.pull_request.number }} \
91+
--body "$(cat interdiff_result.txt)" \
92+
--repo ${{ github.repository }}

0 commit comments

Comments
 (0)