Skip to content

Commit 733abb6

Browse files
committed
Fetch referenced commits in checkpatch
1 parent d0f7265 commit 733abb6

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,21 @@ jobs:
8787
with:
8888
submodules: true
8989
fetch-depth: 2
90+
- name: Fetch referenced commits
91+
working-directory: linux
92+
env:
93+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
run: |
95+
HASHES=$(git log -1 --pretty=%B | tr '\n' ' ' | grep -oP '(?:commit|[\w-]+:)\s+\K[0-9a-f]{12,40}' | sort -u)
96+
97+
for HASH in $HASHES; do
98+
FULL_HASH=$(gh api "repos/torvalds/linux/commits/$HASH" --jq '.sha' 2>/dev/null || true)
99+
if [ -n "$FULL_HASH" ]; then
100+
git fetch origin $FULL_HASH --depth=1 || true
101+
fi
102+
done
103+
- run: git show
104+
working-directory: linux
90105
- name: Run checkpatch
91106
working-directory: linux
92107
run: ./scripts/checkpatch.pl --git HEAD

0 commit comments

Comments
 (0)