Skip to content

Commit

Permalink
workflow: Run checkpatch against diff with riscv (riscv-collab#822)
Browse files Browse the repository at this point in the history
* workflow: Run checkpatch against pull request only

Instead of arbitrarily picking 20 changes.

Change-Id: I5ec488aa4faa0b06056aa91d0432cda1674967b7
Signed-off-by: Tim Newsome <[email protected]>

* Display FETCH_HEAD in the log

Co-authored-by: Jan Matyas <[email protected]>
Signed-off-by: Tim Newsome <[email protected]>

---------

Signed-off-by: Tim Newsome <[email protected]>
Co-authored-by: Jan Matyas <[email protected]>
  • Loading branch information
2 people authored and fanghuaqi committed Jan 25, 2024
1 parent 149f51b commit b587496
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/checkpatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ jobs:
BUILD_DIR: ../build
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 50
fetch-depth: 0
- name: Checkout Base
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
echo "The current base for checkpatch is: $(git show FETCH_HEAD --oneline --raw)"
- name: Install required packages (apt-get)
run: |
sudo apt-get update
sudo apt-get install patchutils
- name: Run checkpatch
run: |
git diff -U20 HEAD~40 \
git diff --patch FETCH_HEAD \
| filterdiff \
-x "a/src/jtag/drivers/libjaylink/*" \
-x "a/tools/git2cl/*" \
Expand Down

0 comments on commit b587496

Please sign in to comment.