From 0324e8ac60645670e1c7d2342f53aee852330de4 Mon Sep 17 00:00:00 2001 From: jo Date: Wed, 8 Nov 2023 10:23:19 +0100 Subject: [PATCH] ci: fix linting jobs diff check --- .github/workflows/lint.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 23006da6..d977450f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,10 +31,11 @@ jobs: go-version: "1.20" - run: go mod tidy - - run: | - if ! git diff --exit-code; then - echo "::error::Found changes in code, don't forget to run 'go mod tidy' before you commit." - fi + + - run: git diff --exit-code + + - if: failure() + run: echo "::error::Found changes in code, don't forget to run 'go mod tidy' before you commit." check-generate: runs-on: ubuntu-latest @@ -45,7 +46,8 @@ jobs: go-version: "1.20" - run: make generate - - run: | - if ! git diff --exit-code; then - echo "::error::Found changes in generated code, don't forget to run 'make generate' before you commit." - fi + + - run: git diff --exit-code + + - if: failure() + run: echo "::error::Found changes in generated code, don't forget to run 'make generate' before you commit."