autopilot-code 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -300,6 +300,15 @@ function logsSystemdService() {
300
300
  (0, node_child_process_1.spawnSync)("journalctl", args, { stdio: "inherit" });
301
301
  }
302
302
  async function initCommand() {
303
+ const logo = `
304
+ _ _ _ _
305
+ (_) |_ _ ___ ___| |_ __ _| |
306
+ | | __| |/ _ \\/ __| __/ _\` | |
307
+ | | |_| | (_) \\__ \\ || (_| | |
308
+ |_|\\__|_|\\___/|___/\\__\\__,_|_|
309
+ `;
310
+ console.log(logo);
311
+ console.log();
303
312
  const cwd = process.cwd();
304
313
  const validation = validatePath(cwd);
305
314
  // 1. Ensure global config exists
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autopilot-code",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "private": false,
5
5
  "description": "Repo-issue–driven autopilot runner",
6
6
  "license": "MIT",
@@ -440,8 +440,31 @@ I'm monitoring the CI checks and will auto-merge once they pass. This may take a
440
440
  # If mergeStateStatus is CLEAN or HAS_HOOKS and statusCheckRollup is null/empty → PASSED
441
441
  # If mergeStateStatus is UNKNOWN → wait and retry
442
442
  if [[ "$MERGE_STATE_STATUS" == "UNKNOWN" ]]; then
443
- CHECK_STATUS="PENDING"
444
- echo "[run_opencode_issue.sh] mergeStateStatus is UNKNOWN, waiting for GitHub to calculate..."
443
+ # Check if there are any CI checks configured
444
+ if command -v jq >/dev/null 2>&1; then
445
+ SCR_IS_NULL=$(echo "$PR_STATUS_JSON" | jq -r '.statusCheckRollup == null')
446
+ SCR_LENGTH=$(echo "$PR_STATUS_JSON" | jq -r '.statusCheckRollup | length // 0')
447
+ else
448
+ SCR_VALUE=$(python3 -c 'import json,sys; data=json.load(sys.stdin); print(data.get("statusCheckRollup", "null"))' <<<"$PR_STATUS_JSON")
449
+ SCR_IS_NULL=$([[ "$SCR_VALUE" == "null" ]] && echo "true" || echo "false")
450
+ SCR_LENGTH=$(python3 -c 'import json,sys; data=json.load(sys.stdin); scr=data.get("statusCheckRollup"); print(len(scr) if scr else 0)' <<<"$PR_STATUS_JSON")
451
+ fi
452
+
453
+ # If no checks configured, wait at most 20 seconds for them to appear
454
+ if [[ "$SCR_IS_NULL" == "true" ]] || [[ "$SCR_LENGTH" == "0" ]]; then
455
+ if [[ $POLL_ATTEMPT -lt 1 ]]; then
456
+ CHECK_STATUS="PENDING"
457
+ echo "[run_opencode_issue.sh] No CI checks configured, waiting up to 20 seconds for checks to appear..."
458
+ sleep 20
459
+ continue
460
+ else
461
+ CHECK_STATUS="PASSED"
462
+ echo "[run_opencode_issue.sh] No checks found after waiting 20 seconds, continuing to merge..."
463
+ fi
464
+ else
465
+ CHECK_STATUS="PENDING"
466
+ echo "[run_opencode_issue.sh] mergeStateStatus is UNKNOWN, waiting for GitHub to calculate..."
467
+ fi
445
468
  elif [[ "$MERGE_STATE_STATUS" == "CLEAN" || "$MERGE_STATE_STATUS" == "HAS_HOOKS" ]]; then
446
469
  # Check statusCheckRollup - if null/empty, no checks configured, so PASSED
447
470
  if command -v jq >/dev/null 2>&1; then