github/workflows/check.yml: Enhance checkpatch for breaking change labels

- Updated the check workflow to conditionally include a '-b' option for breaking change enforcement based on PR labels.
- Modified the checkpatch script to support reading commit messages from stdin when using the '-m -g' flags.
- Improved usage instructions to clarify the new stdin option for commit message checks.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
This commit is contained in:
Arjav Patel
2026-02-24 11:20:04 +05:30
committed by Xiang Xiao
parent 56f0da2efe
commit 1d514dab1a
2 changed files with 17 additions and 3 deletions
+6 -2
View File
@@ -45,5 +45,9 @@ jobs:
cd nuttx
commits="${{ github.event.pull_request.base.sha }}..HEAD"
git log --oneline $commits
echo "../nuttx/tools/checkpatch.sh -c -u -m -g $commits"
../nuttx/tools/checkpatch.sh -c -u -m -g $commits
breaking_opts=""
if echo '${{ toJSON(github.event.pull_request.labels) }}' | jq -e 'any(.[].name; test("breaking change"; "i"))' >/dev/null 2>&1; then
breaking_opts="-b"
fi
echo "../nuttx/tools/checkpatch.sh -c -u -m -g $breaking_opts $commits"
../nuttx/tools/checkpatch.sh -c -u -m -g $breaking_opts $commits