Skip to content

Commit b903d63

Browse files
committed
Improve claude --green error tracking and commit handling
1 parent 0c924f5 commit b903d63

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
@@ -3059,7 +3059,7 @@ Let's work through this together to get CI passing.`
30593059
// Monitor workflow with retries
30603060
let retryCount = 0
30613061
let lastRunId = null
3062-
const pushTime = Date.now()
3062+
let pushTime = Date.now()
30633063

30643064
while (retryCount < maxRetries) {
30653065
log.progress(`Checking CI status (attempt ${retryCount + 1}/${maxRetries})`)
@@ -3204,6 +3204,8 @@ Let's work through this together to get CI passing.`
32043204
cwd: rootPath,
32053205
},
32063206
)
3207+
// Add newline after progress indicator before next output
3208+
console.log('')
32073209

32083210
// Check if we've seen this CI error before
32093211
const ciErrorOutput = logsResult.stdout || 'No logs available'
@@ -3316,6 +3318,15 @@ Fix all CI failures now by making the necessary changes.`
33163318

33173319
if (fixStatusResult.stdout.trim()) {
33183320
log.progress('Committing CI fixes')
3321+
3322+
// Show what files were changed
3323+
const changedFiles = fixStatusResult.stdout
3324+
.trim()
3325+
.split('\n')
3326+
.map(line => line.substring(3))
3327+
.join(', ')
3328+
log.substep(`Changed files: ${changedFiles}`)
3329+
33193330
await runCommand('git', ['add', '.'], { cwd: rootPath })
33203331

33213332
// Commit with descriptive message (no AI attribution per CLAUDE.md)
@@ -3328,7 +3339,7 @@ Fix all CI failures now by making the necessary changes.`
33283339
await runCommand('git', ['push'], { cwd: rootPath })
33293340
log.done(`Pushed fix commit: ${ciFixMessage}`)
33303341

3331-
// Update SHA for next check
3342+
// Update SHA and push time for next check
33323343
const newShaResult = await runCommandWithOutput(
33333344
'git',
33343345
['rev-parse', 'HEAD'],
@@ -3337,6 +3348,7 @@ Fix all CI failures now by making the necessary changes.`
33373348
},
33383349
)
33393350
currentSha = newShaResult.stdout.trim()
3351+
pushTime = Date.now()
33403352
}
33413353

33423354
retryCount++

0 commit comments

Comments
 (0)