Skip to content

Commit a2ccf62

Browse files
authored
Merge pull request #28 from githubnext/copilot/fix-scheduling-pre-step-exit
Fix scheduling pre-step to exit cleanly when no programs are due
2 parents 7b8e8a0 + 2c3b7b9 commit a2ccf62

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

workflows/autoloop.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ steps:
541541
issueProgramsMap[name] = info.issue_number;
542542
}
543543
544+
const notDue = !selected && unconfigured.length === 0;
544545
const result = {
545546
selected: selected,
546547
selected_file: selectedFile,
@@ -551,6 +552,7 @@ steps:
551552
skipped: skipped,
552553
unconfigured: unconfigured,
553554
no_programs: false,
555+
not_due: notDue,
554556
};
555557
556558
fs.mkdirSync('/tmp/gh-aw', { recursive: true });
@@ -564,7 +566,7 @@ steps:
564566
565567
if (!selected && unconfigured.length === 0) {
566568
console.log('\nNo programs due this run. Exiting early.');
567-
process.exit(1); // Non-zero exit skips the agent step
569+
process.exit(0);
568570
}
569571
}
570572
@@ -653,6 +655,7 @@ The pre-step has already determined which program to run. Read `/tmp/gh-aw/autol
653655
- **`unconfigured`**: Programs that still have the sentinel or placeholder content.
654656
- **`skipped`**: Programs not due yet based on their per-program schedule.
655657
- **`no_programs`**: If `true`, no program files exist at all.
658+
- **`not_due`**: If `true`, programs exist but none are due for this run.
656659

657660
If `selected` is not null:
658661
1. Read the program file from the `selected_file` path.

0 commit comments

Comments
 (0)