Skip to content

Fix lint automation workflow failing when no lint errors are found#34

Merged
BorDevTech merged 2 commits into
mainfrom
copilot/fix-33
Sep 21, 2025
Merged

Fix lint automation workflow failing when no lint errors are found#34
BorDevTech merged 2 commits into
mainfrom
copilot/fix-33

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 21, 2025

The lint automation workflow was incorrectly failing builds even when no lint errors were present. The issue was in the workflow logic that determines whether lint issues exist.

Problem

The workflow step "🔍 Run lint analysis" was setting has-issues=true whenever the lint-analysis-report.json file existed, regardless of the actual issue count. Since the lint analyzer always creates this report file (even when there are 0 issues), this caused the workflow to incorrectly think there were lint problems and trigger the "❌ Fail build on lint errors" step.

Root Cause

In .github/workflows/lint-automation.yml, the logic was:

if [ -f "lint-analysis-report.json" ]; then
  ISSUES_COUNT=$(jq '.summary.totalIssues' lint-analysis-report.json)
  echo "has-issues=true" >> $GITHUB_OUTPUT  # ← Always true if file exists!

This meant that has-issues was set to true whenever the report file existed, even when totalIssues was 0.

Solution

Modified the workflow to check the actual issue count before setting the has-issues flag:

if [ -f "lint-analysis-report.json" ]; then
  ISSUES_COUNT=$(jq '.summary.totalIssues' lint-analysis-report.json)
  echo "issues-count=${ISSUES_COUNT}" >> $GITHUB_OUTPUT
  
  if [ "${ISSUES_COUNT}" -gt "0" ]; then
    echo "has-issues=true" >> $GITHUB_OUTPUT
  else
    echo "has-issues=false" >> $GITHUB_OUTPUT
  fi

Now the workflow correctly:

  • Sets has-issues=false when there are 0 lint issues
  • Sets has-issues=true only when there are actual lint issues
  • Allows builds to pass when code quality standards are met

Fixes #33.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
clear-view Error Error Sep 21, 2025 11:34pm

Co-authored-by: BorDevTech <73800053+BorDevTech@users.noreply.github.com>
Copilot AI changed the title [WIP] Failing when no lint errors Fix lint automation workflow failing when no lint errors are found Sep 21, 2025
Copilot AI requested a review from BorDevTech September 21, 2025 23:34
@BorDevTech BorDevTech marked this pull request as ready for review September 21, 2025 23:37
Copilot AI review requested due to automatic review settings September 21, 2025 23:37
@BorDevTech BorDevTech merged commit 4eced1e into main Sep 21, 2025
7 of 8 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a critical issue in the lint automation workflow where builds were incorrectly failing even when no lint errors were present. The workflow was setting has-issues=true whenever the lint report file existed, regardless of the actual issue count.

Key changes:

  • Modified workflow logic to check the actual issue count before setting the has-issues flag
  • Added conditional logic to properly set has-issues=false when there are 0 lint issues
  • Improved feedback messages to clearly indicate when no issues are found

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@BorDevTech BorDevTech deleted the copilot/fix-33 branch September 21, 2025 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failing when no lint errors

3 participants