From 15229d00cc5b765024daebd1a1a4373e73c020dc Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Fri, 28 Apr 2023 15:37:47 +0300 Subject: [PATCH] github: Enhance checkpatch_pull error handling Add an error variable to track errors during the loop in checkpatch_pull.yml, allowing the workflow to run checkpatch for all commits before exiting with the appropriate status. Additionally, add COMMIT_LOG_USE_LINK to the ignore list for both pull and push workflows --- .github/workflows/checkpatch_pull.yml | 7 ++++++- .github/workflows/checkpatch_push.yml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checkpatch_pull.yml b/.github/workflows/checkpatch_pull.yml index 3cb4eee70..c231e64b5 100644 --- a/.github/workflows/checkpatch_pull.yml +++ b/.github/workflows/checkpatch_pull.yml @@ -29,6 +29,7 @@ jobs: EMAIL_SUBJECT UNKNOWN_COMMIT_ID NO_AUTHOR_SIGN_OFF + COMMIT_LOG_USE_LINK FILE_PATH_CHANGES SPDX_LICENSE_TAG LINUX_VERSION_CODE @@ -39,9 +40,13 @@ jobs: base_commit=${{github.event.pull_request.base.sha}} commits=$(git log --pretty=format:"%h" $base_commit..HEAD) + err=0 for commit in $commits; do echo "Running checkpatch.pl for commit $commit" - git format-patch -1 --stdout $commit | ./checkpatch.pl --no-tree --show-types --ignore="${ignore_str// /,}" - + echo "========================================" + git format-patch -1 --stdout $commit | ./checkpatch.pl --no-tree --show-types --ignore="${ignore_str// /,}" - || err=1 echo done + + exit $err diff --git a/.github/workflows/checkpatch_push.yml b/.github/workflows/checkpatch_push.yml index 98484cd5f..c5071f46f 100644 --- a/.github/workflows/checkpatch_push.yml +++ b/.github/workflows/checkpatch_push.yml @@ -34,6 +34,7 @@ jobs: EMAIL_SUBJECT UNKNOWN_COMMIT_ID NO_AUTHOR_SIGN_OFF + COMMIT_LOG_USE_LINK FILE_PATH_CHANGES SPDX_LICENSE_TAG LINUX_VERSION_CODE