This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new caa178d992a .github/workflows/check.yml: compute the checkpatch range 
from the merge base
caa178d992a is described below

commit caa178d992a354ac98e417f15e5f75d565d78288
Author: raiden00pl <[email protected]>
AuthorDate: Thu Oct 15 22:05:15 2026 +0200

    .github/workflows/check.yml: compute the checkpatch range from the merge 
base
    
    github.event.pull_request.base.sha is a cached value that GitHub updates
    asynchronously, so a synchronize event can carry the base SHA from when
    the PR was opened even after the branch was rebased onto the current
    base. The checked range then spans every commit that landed on the base
    branch since, and any commit there that fails checkpatch fails the PR.
    
    Compute the range from the merge base against the live base branch so
    only the PR commits are checked.
    
    Assisted-by: Claude Code
    Signed-off-by: raiden00pl <[email protected]>
---
 .github/workflows/check.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index 56307bac250..b84f857904e 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -41,7 +41,8 @@ jobs:
           source .venv/bin/activate
           pip install codespell cmake-format black isort flake8 cvt2utf
           cd nuttx
-          commits="${{ github.event.pull_request.base.sha }}..HEAD"
+          git fetch origin ${{ github.base_ref }}
+          commits="$(git merge-base origin/${{ github.base_ref }} HEAD)..HEAD"
           git log --oneline $commits
           breaking_opts=""
           if echo '${{ toJSON(github.event.pull_request.labels) }}' | jq -e 
'any(.[].name; test("breaking change"; "i"))' >/dev/null 2>&1; then

Reply via email to