Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/actions/bot-ci-failure/analyze_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,21 @@ def main():
):
print("::warning::Skipping: No failure logs to analyse.", file=sys.stderr)
return
if not error_log.strip():
print("::warning::Skipping: Empty failure logs.", file=sys.stderr)
return
if not tests_failed and not transient_only:
no_failure_patterns = [
"No failed jobs found",
"Failed jobs found but logs unavailable",
"Could not fetch failed jobs",
]
if any(p in error_log for p in no_failure_patterns):
print(
"::notice::No CI failures detected; skipping analysis.",
file=sys.stderr,
)
return
# Only fetch the full repository code context when automated tests
# actually failed. For QA-only or commit-message failures the code
# is not needed and would waste prompt tokens.
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/reusable-bot-ci-failure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,8 @@ jobs:
echo "AI analysis produced no output; skipping comment."
exit 0
fi
if ! grep -q "##\[error\]" failed_logs.txt 2>/dev/null; then
echo "No CI failures detected; skipping comment."
exit 0
fi
gh pr comment "$PR_NUM" --repo "$REPO" --body-file solution.md
Loading