]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
build: add checkpatch to catch style issues
authorDaniel Wagner <dwagner@suse.de>
Wed, 13 Dec 2023 08:02:56 +0000 (09:02 +0100)
committerDaniel Wagner <wagi@monom.org>
Wed, 13 Dec 2023 08:08:21 +0000 (09:08 +0100)
Signed-off-by: Daniel Wagner <dwagner@suse.de>
.github/workflows/checkpatch.yml [new file with mode: 0644]

diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml
new file mode 100644 (file)
index 0000000..8cf5e49
--- /dev/null
@@ -0,0 +1,15 @@
+name: checkpatch review
+on: [pull_request]
+jobs:
+  checkpatch:
+    name: checkpatch review
+    runs-on: ubuntu-latest
+    steps:
+    - name: 'Calculate PR commits + 1'
+      run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV
+    - uses: actions/checkout@v4
+      with:
+        ref: ${{ github.event.pull_request.head.sha }}
+        fetch-depth: ${{ env.PR_FETCH_DEPTH }}
+    - name: Run checkpatch review
+      uses: webispy/checkpatch-action@v9