You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cb0d99b
Browse filesBrowse the repository at this point in the historyBrowse files
// A GitHub Actions workflow '${workflowName}' failed.
76
+
77
+
// Analyze the following log snippet (last ${MAX_LOG_LINES} lines) to identify the root cause.
78
+
79
+
// Log Snippet:
80
+
// \`\`\`
81
+
// ${tailLogs}
82
+
// \`\`\`
83
+
84
+
// Your response must be a concise Markdown comment suitable for a developer.
85
+
// Structure:
86
+
87
+
// ## 🩺 Build Doctor Diagnosis
88
+
89
+
// **1. Root Cause:**
90
+
// (Explain what went wrong in 1-2 senteces. Be specific: Syntax error, Dependencies, Test failure, Infra, etc.)
91
+
92
+
// **2. Relevant Log Lines:**
93
+
// (Quote the specific error message from the logs)
94
+
95
+
// **3. Suggested Fix:**
96
+
// (Actionable advice. If it's a code fix, show the snippet. If it's a config tweak, show the command or yaml change.)
97
+
98
+
// **Confidence:** (High/Medium/Low)
99
+
// `;
73
100
constprompt=`
74
-
You are a DevOps Expert and "Build Doctor".
75
-
A GitHub Actions workflow '${workflowName}' failed.
101
+
You are an expert DevOps engineer and "Build Doctor".
102
+
A GitHub Actions workflow '${workflowName}' has failed.
103
+
104
+
Your job:
105
+
- Read the log snippet carefully.
106
+
- Identify the **single most likely root cause** of the failure.
107
+
- Map it to a clear category (Syntax, Dependency, Test, Infra, Config, Credential, Network, Tooling, etc.).
108
+
- Propose **one** primary fix that a developer can apply quickly.
76
109
77
-
Analyze the following log snippet (last ${MAX_LOG_LINES} lines) to identify the root cause.
110
+
Context:
111
+
- These are the last ${MAX_LOG_LINES} lines of the job log.
112
+
- They may contain retries, warnings, and noisy stack traces.
113
+
- The **true error** is usually near the first occurrence of "error", "exception", "failed", "fatal", non‑zero exit codes, or GitHub Actions step failure messages.
78
114
79
115
Log Snippet:
80
116
\`\`\`
81
117
${tailLogs}
82
118
\`\`\`
83
119
84
-
Your response must be a concise Markdown comment suitable for a developer.
85
-
Structure:
120
+
First, think step by step (do NOT include this reasoning in the final answer):
121
+
1. Skim for the first real failure signal (error/exception/exit code/failed step).
122
+
2. Summarize in your own words what actually went wrong.
123
+
3. Decide which category it belongs to: Syntax, Dependency, Test, Infra, Config, Credential, Network, Tooling, Other.
124
+
4. Decide the most likely fix a DevOps/dev engineer should try first.
125
+
5. If there is not enough information, state that clearly and suggest what extra logs/checks are needed.
86
126
87
-
## 🩺 Build Doctor Diagnosis
127
+
Then, output **only** the following Markdown comment, nothing else:
88
128
89
-
**1. Root Cause:**
90
-
(Explain what went wrong in 1-2 senteces. Be specific: Syntax error, Dependencies, Test failure, Infra, etc.)
129
+
# 🩺 Build Doctor Diagnosis
91
130
92
-
**2. Relevant Log Lines:**
93
-
(Quote the specific error message from the logs)
131
+
### Diagnosis (${workflowName})
132
+
**1. Root Cause:**
133
+
(Explain what went wrong in 1–2 sentences. Be specific: e.g. "Maven dependency not found", "JUnit test failure", "Docker login failed", "Kubernetes connection timeout". If unsure, say "Most likely ..." and why.)
94
134
95
-
**3. Suggested Fix:**
96
-
(Actionable advice. If it's a code fix, show the snippet. If it's a config tweak, show the command or yaml change.)
135
+
**2. Relevant Log Lines:**
136
+
(Quote the *minimal* most important 1–3 lines from the logs that show the error. Do not paste large blocks.)
97
137
98
-
**Confidence:** (High/Medium/Low)
138
+
**3. Suggested Fix:**
139
+
(Give concrete, copy‑pasteable steps.
140
+
- For code issues: show the key code or config snippet to change.
141
+
- For pipeline/config issues: show the YAML or command to adjust.
142
+
- For infra/credentials: describe exact checks or commands to run, and what to update.)
143
+
144
+
**Confidence:** High | Medium | Low
145
+
(Choose one based on how clear the error is. If logs are ambiguous or truncated, use Medium or Low and say what’s missing.)
0 commit comments