Skip to content

Commit 057eb71

Browse files
committed
workflow: Fix the PR review CI
Improving checkpatch to function properly, as it earlier did not catch errors properly. One such incident was brought to light when a missing SOB went undetected. Ensure that such errors are caught when the PRs are raised itself. Signed-off-by: Dhruva Gole <[email protected]>
1 parent b715281 commit 057eb71

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

.github/workflows/checkpatch.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This is a basic workflow to help you get started with Actions
22

3-
name: CI
3+
name: checkpatch review
44

55
# Controls when the workflow will run
66
on:
@@ -15,15 +15,16 @@ on:
1515

1616
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1717
jobs:
18-
# This workflow contains a single job called "build"
19-
build:
20-
# The type of runner that the job will run on
18+
my_review:
19+
name: checkpatch review
2120
runs-on: ubuntu-latest
22-
23-
# Steps represent a sequence of tasks that will be executed as part of the job
2421
steps:
25-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26-
- uses: actions/checkout@v3
27-
- name: checkpatch.pl PR review
28-
uses: webispy/checkpatch-action@v8
22+
- name: 'Calculate PR commits + 1'
23+
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV
24+
- uses: actions/checkout@v3
25+
with:
26+
ref: ${{ github.event.pull_request.head.sha }}
27+
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
28+
- name: Run checkpatch review
29+
uses: webispy/checkpatch-action@v9
2930

0 commit comments

Comments
 (0)