Skip to content

Commit 9caaa97

Browse files
committed
Improve claude --green error tracking and commit handling
1 parent 9dd63aa commit 9caaa97

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

scripts/claude.mjs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3016,7 +3016,7 @@ Let's work through this together to get CI passing.`
30163016
// Monitor workflow with retries
30173017
let retryCount = 0
30183018
let lastRunId = null
3019-
const pushTime = Date.now()
3019+
let pushTime = Date.now()
30203020

30213021
while (retryCount < maxRetries) {
30223022
log.progress(`Checking CI status (attempt ${retryCount + 1}/${maxRetries})`)
@@ -3161,6 +3161,8 @@ Let's work through this together to get CI passing.`
31613161
cwd: rootPath,
31623162
},
31633163
)
3164+
// Add newline after progress indicator before next output
3165+
console.log('')
31643166

31653167
// Analyze and fix with Claude
31663168
log.progress('Analyzing CI failure with Claude')
@@ -3250,6 +3252,15 @@ Fix all CI failures now by making the necessary changes.`
32503252

32513253
if (fixStatusResult.stdout.trim()) {
32523254
log.progress('Committing CI fixes')
3255+
3256+
// Show what files were changed
3257+
const changedFiles = fixStatusResult.stdout
3258+
.trim()
3259+
.split('\n')
3260+
.map(line => line.substring(3))
3261+
.join(', ')
3262+
log.substep(`Changed files: ${changedFiles}`)
3263+
32533264
await runCommand('git', ['add', '.'], { cwd: rootPath })
32543265
await runCommand(
32553266
'git',
@@ -3263,7 +3274,7 @@ Fix all CI failures now by making the necessary changes.`
32633274
)
32643275
await runCommand('git', ['push'], { cwd: rootPath })
32653276

3266-
// Update SHA for next check
3277+
// Update SHA and push time for next check
32673278
const newShaResult = await runCommandWithOutput(
32683279
'git',
32693280
['rev-parse', 'HEAD'],
@@ -3272,6 +3283,7 @@ Fix all CI failures now by making the necessary changes.`
32723283
},
32733284
)
32743285
currentSha = newShaResult.stdout.trim()
3286+
pushTime = Date.now()
32753287
}
32763288

32773289
retryCount++

0 commit comments

Comments
 (0)