From ef19e6bc80072c226e3690d7115b2d90877eed3f Mon Sep 17 00:00:00 2001 From: OnkarRuikar <87750369+OnkarRuikar@users.noreply.github.com> Date: Tue, 1 Aug 2023 15:39:35 +0530 Subject: [PATCH] fail the workflow till there are lint issues --- .github/workflows/pr-review-lint.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/pr-review-lint.yml b/.github/workflows/pr-review-lint.yml index 74a007303764b02..d10b8a19990963d 100644 --- a/.github/workflows/pr-review-lint.yml +++ b/.github/workflows/pr-review-lint.yml @@ -69,6 +69,10 @@ jobs: echo "Running Prettier" yarn prettier -w ${files_to_lint} + if [[ -n $(git diff) || "${MD_LINT_STATUS}" == "1" || "${FM_LINT_STATUS}" == "1" ]]; then + echo "CHANGES_REQUIRED=true" >> $GITHUB_ENV + fi + - name: Setup reviewdog uses: reviewdog/action-setup@v1 with: @@ -105,3 +109,9 @@ jobs: run: | echo "${{ env.FM_LINT_LOG }}" exit 1 + + - name: Fail till changes are pending + if: env.CHANGES_REQUIRED == 'true' + run: | + echo "Please fix all the linting issues suggested in the review comments." + exit 1