diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5f6198..d021aa8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,8 @@ jobs: name: Validation if: "!contains(github.event.head_commit.message, '[skip ci]')" runs-on: ubuntu-latest + env: + SSHDOL_SYNC_TO_EXTRA_SSH_OPTIONS: "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" strategy: matrix: python-version: ["3.10"] diff --git a/sshdol/base.py b/sshdol/base.py index 92a6780..beced85 100644 --- a/sshdol/base.py +++ b/sshdol/base.py @@ -771,6 +771,13 @@ def sync_to( ssh_parts = ["ssh", "-p", str(self._conn_port)] if self._conn_key_filename: ssh_parts += ["-i", self._conn_key_filename] + + # Add extra SSH options from environment variable if set + # This allows CI environments or users to specify additional SSH options + extra_ssh_options = os.environ.get('SSHDOL_SYNC_TO_EXTRA_SSH_OPTIONS') + if extra_ssh_options: + # Split the string into individual options, handling quoted arguments properly + ssh_parts += shlex.split(extra_ssh_options) ssh_cmd_str = " ".join(shlex.quote(p) for p in ssh_parts) # Build rsync args