From 6e89ea331227c44875dc7951080141b69cf5562f Mon Sep 17 00:00:00 2001 From: root Date: Fri, 10 Jul 2026 10:26:36 +0300 Subject: [PATCH] fix(installer): close organization sync loop --- .github/workflows/autopilot-org-installer.yml | 1 + memory/examples/20260710_installer-bash-loop.md | 8 ++++++++ tests/validate_workflows.py | 9 +++++++++ 3 files changed, 18 insertions(+) create mode 100644 memory/examples/20260710_installer-bash-loop.md diff --git a/.github/workflows/autopilot-org-installer.yml b/.github/workflows/autopilot-org-installer.yml index f4e261d..02f1a2e 100644 --- a/.github/workflows/autopilot-org-installer.yml +++ b/.github/workflows/autopilot-org-installer.yml @@ -102,3 +102,4 @@ jobs: cd "${GITHUB_WORKSPACE}" rm -rf "${tmp}" + done diff --git a/memory/examples/20260710_installer-bash-loop.md b/memory/examples/20260710_installer-bash-loop.md new file mode 100644 index 0000000..dad7c13 --- /dev/null +++ b/memory/examples/20260710_installer-bash-loop.md @@ -0,0 +1,8 @@ +# Installer Bash loop termination + +Issue Description: The scheduled Autopilot Org Installer failed before processing repositories with `syntax error: unexpected end of file`. +State: The workflow opened a Bash `for repo` loop without a matching `done`. +Action: Added the missing `done` and a workflow validation check that runs `bash -n` on the embedded installer script. +Result: The installer script now parses before GitHub Actions executes it. +Diff Patch: Updated the installer workflow and `tests/validate_workflows.py`. +Rationale: Workflow YAML validation alone cannot detect syntax errors inside multiline Bash blocks. diff --git a/tests/validate_workflows.py b/tests/validate_workflows.py index 87fb6ae..ca65b6f 100644 --- a/tests/validate_workflows.py +++ b/tests/validate_workflows.py @@ -1,4 +1,5 @@ from pathlib import Path +import subprocess import yaml @@ -13,6 +14,14 @@ def main() -> None: yaml.safe_load(stream) print(f"OK: {workflow}") + with Path(".github/workflows/autopilot-org-installer.yml").open(encoding="utf-8") as stream: + installer = yaml.safe_load(stream) + script = installer["jobs"]["installer"]["steps"][1]["run"] + result = subprocess.run(["bash", "-n"], input=script, text=True, capture_output=True) + if result.returncode: + raise SystemExit(f"Installer Bash syntax error: {result.stderr.strip()}") + print("OK: autopilot-org-installer Bash syntax") + print(f"Validated {len(workflows)} workflow files")