Skip to content

cron: CI Health Check sends a false 'CI failing' alert on Windows (cmd.exe quoting, condition ignores exit code) #1921

Closed

Description

@amrmelsayed

Problem

On native Windows the CI Health Check cron task sends a false alert to the architect every 30 minutes:

CI Alert: currently failing on main: 'map' is not recognized as an internal or external command,
operable program or batch file.. Run `gh run list --limit 5` to investigate.

CI on main is green when these arrive (checked with gh run list --branch main on 2026-11-18).

Cause

.af-cron/ci-health.yaml:

command: gh run list --branch main --limit 10 --json workflowName,conclusion --jq 'group_by(.workflowName) | map(.[0]) | map(select(.conclusion == "failure")) | map(.workflowName) | join(", ")'
condition: "output != ''"

Two faults:

  1. Tower cron runs the command with exec, which on Windows is cmd.exe /d /s /c. cmd.exe does not treat single quotes as quotes, so the | inside the jq expression is a pipe to a program named map.
  2. The condition is output != '', and a condition is evaluated on failed runs too, so the command's own error text is reported as the list of failing workflows. Any failure of the check (gh missing, not authenticated, network down) reads as "CI failing" on every platform.

Fix shape

  1. Make the command work under both cmd.exe and a POSIX shell (quoting that both accept, or a small script the task invokes; the builder picks and says why).
  2. Make the condition require a successful run, e.g. exitCode == 0 && output != '', so a broken check never reports as a CI failure. Decide whether a failed check should alert separately with its own wording.
  3. Check the other task in .af-cron/ (team-update.yaml) and any cron example or template under codev-skeleton/ and the afx skill docs for the same single-quote pattern.

Acceptance

  • On Windows, with CI green on main, the task sends nothing; with a failing workflow it names the workflow.
  • On macOS/Linux behaviour is unchanged for the green and failing cases.
  • A failing command (e.g. gh unavailable) does not produce a "CI Alert: currently failing on main" message.

Related: #1919 (hides the cmd.exe window this task opens; does not change the shell).

Activity

  1. added
    area/tower
    on Nov 18, 2026
  2. amrmelsayed commented on Nov 18, 2026

    @amrmelsayed
    CollaboratorAuthor

    On it! Working on a fix now.

  3. added 5 commits that reference this issue on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/tower

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions