From b587496d175845083e4be79ccc78f83978df5b32 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Thu, 13 Apr 2023 08:38:59 -0700 Subject: [PATCH] workflow: Run checkpatch against diff with riscv (#822) * workflow: Run checkpatch against pull request only Instead of arbitrarily picking 20 changes. Change-Id: I5ec488aa4faa0b06056aa91d0432cda1674967b7 Signed-off-by: Tim Newsome * Display FETCH_HEAD in the log Co-authored-by: Jan Matyas <50193733+JanMatCodasip@users.noreply.github.com> Signed-off-by: Tim Newsome --------- Signed-off-by: Tim Newsome Co-authored-by: Jan Matyas <50193733+JanMatCodasip@users.noreply.github.com> --- .github/workflows/checkpatch.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml index c9ec78d596..dbebf8d7d3 100644 --- a/.github/workflows/checkpatch.yml +++ b/.github/workflows/checkpatch.yml @@ -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/*" \