From a08aa8dccbdf96322dac89ab805cbde8097992cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 9 Jan 2023 19:49:58 +0100 Subject: [PATCH] Make `check-whitespace.yml`check the final result only (#2158) --- .github/workflows/check-whitespace.yml | 37 +++++--------------------- 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml index a2e041c315..0138775200 100644 --- a/.github/workflows/check-whitespace.yml +++ b/.github/workflows/check-whitespace.yml @@ -17,33 +17,10 @@ jobs: with: fetch-depth: 0 - - name: git log --check - id: check_out - run: | - log= - commit= - while read dash etc - do - case "${dash}" in - "---") - commit="${etc}" - ;; - "") - ;; - *) - if test -n "${commit}" - then - log="${log}\n${commit}" - echo "" - echo "--- ${commit}" - fi - commit= - log="${log}\n${dash} ${etc}" - echo "${dash} ${etc}" - ;; - esac - done <<< $(git log --check --pretty=format:"---% h% s" ${{github.event.pull_request.base.sha}}..) - if test -n "${log}" - then - exit 2 - fi + - run: git checkout ${{github.event.pull_request.base.sha}} + - run: git merge --squash ${{github.event.pull_request.head.sha}} + - run: | + git config --global user.name "check-whitespace" + git config --global user.email "check-whitespace@example.com" + - run: git commit -m "Squashed" + - run: git log --check HEAD^..HEAD