From 7f056c86cad2dee1f667821e5b8d5b6abf4e0cb0 Mon Sep 17 00:00:00 2001 From: Anirudh Ramchandran Date: Tue, 17 Sep 2024 22:48:15 -0400 Subject: [PATCH] do not exit prematurely if errors or warnings are found --- .github/workflows/lint-and-license-check.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint-and-license-check.yml b/.github/workflows/lint-and-license-check.yml index 944d0fea..db0796b2 100644 --- a/.github/workflows/lint-and-license-check.yml +++ b/.github/workflows/lint-and-license-check.yml @@ -26,7 +26,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: '16' + node-version: '16' - name: Install dependencies working-directory: app/frontend @@ -56,15 +56,15 @@ jobs: exit $exit_code - - name: Comment on PR with ESLint errors - if: github.event_name == 'pull_request' && env.HAS_ERRORS == 'true' + - name: Comment on PR with ESLint Errors + if: env.HAS_ERRORS == 'true' uses: actions/github-script@v7 with: script: | const lintOutput = process.env.CLEAN_OUTPUT; const issueNumber = context.issue.number || context.payload.pull_request.number; const owner = context.repo.owner; - const repo = repo.repo; + const repo = context.repo.repo; if (lintOutput) { const commentBody = `## ESLint Errors:\n\`\`\`\n${lintOutput}\n\`\`\`\nPlease fix the errors mentioned above.`; @@ -76,3 +76,7 @@ jobs: }); } else { console.log("No ESLint errors to report."); + + - name: Fail if Errors Exist + if: env.HAS_ERRORS == 'true' + run: exit 1 # Fail the workflow if errors exist