From 82cb5b7181cee04b354cabedda7094976bbd7e7e Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Thu, 2 Jan 2025 21:38:30 +0100 Subject: [PATCH] Fix the checkpatch.pl workflow - The MAINTAINERS test is not valid for libfuse. - Correct the base commit Signed-off-by: Bernd Schubert --- .github/workflows/checkpatch.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml index 9a3cd1b..3f0eb9f 100644 --- a/.github/workflows/checkpatch.yml +++ b/.github/workflows/checkpatch.yml @@ -18,5 +18,14 @@ jobs: - name: Run checkpatch.pl run: | git fetch origin ${{ github.base_ref }} - base_commit=$(git merge-base FETCH_HEAD ${{ github.event.pull_request.head.sha }}) - ./checkpatch.pl --no-tree -g $base_commit + base_commit=$(git merge-base origin/${{ github.base_ref }} HEAD) + echo "Base commit: $base_commit" + echo "Running checkpatch.pl on all commits in the PR:" + git rev-list --reverse $base_commit..HEAD | while read commit; do + subject=$(git log -1 --format=%s $commit) + echo "Checking commit: $commit - $subject" + if ! ./checkpatch.pl --no-tree --ignore MAINTAINERS,SPDX_LICENSE_TAG,COMMIT_MESSAGE,FILE_PATH_CHANGES,EMAIL_SUBJECT -g $commit; then + echo "checkpatch.pl found issues in commit $commit - $subject" + exit 1 + fi + done -- 2.30.2