|
35 | 35 | with: |
36 | 36 | python-version: '3.x' |
37 | 37 |
|
| 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 | +
|
38 | 58 | - name: Run upstream fixes check |
39 | 59 | id: checkkernel |
40 | 60 | run: | |
|
44 | 64 | echo "has_findings=true" >> $GITHUB_OUTPUT |
45 | 65 | fi |
46 | 66 |
|
| 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 | +
|
47 | 76 | - name: Comment on PR if issues found |
48 | 77 | if: steps.checkkernel.outputs.has_findings == 'true' |
49 | 78 | env: |
|
52 | 81 | gh pr comment ${{ github.event.pull_request.number }} \ |
53 | 82 | --body "$(cat result.txt)" \ |
54 | 83 | --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