Deploy helper now resolves Forgejo/GitHub remotes without hardcoded origin

Date: 2026-05-17 · Issue: islandflow-1ei · Files changed: scripts/deploy.ts

Summary

Updated scripts/deploy.ts so deploy operations no longer assume a git remote named origin. The deploy helper now auto-resolves an available remote (Forgejo-aware), uses it consistently across fetch/pull/push and remote checkout updates, and supports explicit override with DEPLOY_GIT_REMOTE.

Changes Made

Context

The repository now includes forgejo and github remotes and may not define origin at all. Hardcoding origin caused deploy fragility in both local precheck and remote rollout flows.

Important Implementation Details

Remote resolution prioritizes explicit operator intent and branch metadata, then falls back to a stable preference order and discovered remotes.

candidates = [
  DEPLOY_GIT_REMOTE,
  branch.<name>.remote,
  upstream remote,
  branch.main.remote,
  forgejo, origin, github,
  all discovered remotes
]

The selected remote is then threaded through all deploy git operations to avoid local/remote mismatch from hardcoded remote names.

Expected Impact for End-Users

Operators should no longer see deploy failures caused solely by missing origin. Deploy commands should work in mixed Forgejo/GitHub environments with fewer manual fixes and less confusion.

Validation

Issues, Limitations, and Mitigations

Follow-up Work