From 3698abf6037dadf2588bd0e2cf07a8887b489878 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Mon, 23 Oct 2023 10:59:24 +0300 Subject: [PATCH] .github: add trailing whitespace error check. Add trailing whitespace error check to our project-checks workflow. Signed-off-by: Krisztian Litkey --- .github/workflows/project-checks.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/project-checks.yaml b/.github/workflows/project-checks.yaml index cce056bb0..302cd0ddb 100644 --- a/.github/workflows/project-checks.yaml +++ b/.github/workflows/project-checks.yaml @@ -27,6 +27,17 @@ jobs: with: go-version: ${{ env.GO_VERSION }} + - name: Git-check trailing whitespace errors + if: ${{ github.event_name == 'pull_request' }} + run: | + git fetch origin ${{ github.base_ref }} + if git diff-index --check origin/${{ github.base_ref }} --; then + echo "OK, no whitespace errors" + else + echo "This PR would introduce trailing whitespace errors." + echo "Please fix them and update the PR." + exit 1 + fi - name: make verify run: | make verify