diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index 756360c26..ac3c144e6 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -36,8 +36,7 @@ jobs:
     - name: Check Pull Request
       run: |
         cd apps
-        ranges=`git log -1 --merges --pretty=format:%P | awk -F" " '{ print $1 ".." $2 }'`
-        git log --oneline $ranges
-        commits=`git log --reverse --format=format:%H $ranges`
+        commits=`git log -1 --merges --pretty=format:%P | awk -F" " '{ print $1 ".." $2 }'`
+        git log --oneline $commits
         echo "../nuttx/tools/checkpatch.sh -g $commits"
         ../nuttx/tools/checkpatch.sh -g $commits