Skip to content

Commit 08093c7

Browse files
committed
Improve claude --green error tracking and commit handling
1 parent 9ce2917 commit 08093c7

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
@@ -2971,7 +2971,7 @@ Let's work through this together to get CI passing.`
29712971
// Monitor workflow with retries
29722972
let retryCount = 0
29732973
let lastRunId = null
2974-
const pushTime = Date.now()
2974+
let pushTime = Date.now()
29752975

29762976
while (retryCount < maxRetries) {
29772977
log.progress(`Checking CI status (attempt ${retryCount + 1}/${maxRetries})`)
@@ -3116,6 +3116,8 @@ Let's work through this together to get CI passing.`
31163116
cwd: rootPath,
31173117
},
31183118
)
3119+
// Add newline after progress indicator before next output
3120+
console.log('')
31193121

31203122
// Analyze and fix with Claude
31213123
log.progress('Analyzing CI failure with Claude')
@@ -3205,6 +3207,15 @@ Fix all CI failures now by making the necessary changes.`
32053207

32063208
if (fixStatusResult.stdout.trim()) {
32073209
log.progress('Committing CI fixes')
3210+
3211+
// Show what files were changed
3212+
const changedFiles = fixStatusResult.stdout
3213+
.trim()
3214+
.split('\n')
3215+
.map(line => line.substring(3))
3216+
.join(', ')
3217+
log.substep(`Changed files: ${changedFiles}`)
3218+
32083219
await runCommand('git', ['add', '.'], { cwd: rootPath })
32093220
await runCommand(
32103221
'git',
@@ -3218,7 +3229,7 @@ Fix all CI failures now by making the necessary changes.`
32183229
)
32193230
await runCommand('git', ['push'], { cwd: rootPath })
32203231

3221-
// Update SHA for next check
3232+
// Update SHA and push time for next check
32223233
const newShaResult = await runCommandWithOutput(
32233234
'git',
32243235
['rev-parse', 'HEAD'],
@@ -3227,6 +3238,7 @@ Fix all CI failures now by making the necessary changes.`
32273238
},
32283239
)
32293240
currentSha = newShaResult.stdout.trim()
3241+
pushTime = Date.now()
32303242
}
32313243

32323244
retryCount++

0 commit comments

Comments
 (0)