Add trusted SSH host key entries to ~/.ssh/known_hosts without fetching keys from the network during a workflow run.
This action is useful when a job needs to connect to a deployment server, bastion, or remote Docker host over SSH and you want strict host key verification without repeating shell setup in every workflow.
- Keeps SSH host key verification explicit and reviewable.
- Avoids runtime
ssh-keyscancalls inside CI/CD jobs. - Adds only missing trusted entries, so repeated runs stay idempotent.
steps:
- name: Add deployment host key
uses: Makepad-fr/add-ssh-host-key-action@v1
with:
server_ip_address: ${{ vars.SERVER_IP_ADDRESS }}
known_host_entry: ${{ secrets.SERVER_SSH_KNOWN_HOST }}| Name | Required | Description |
|---|---|---|
server_ip_address |
yes | Server IP address or hostname used in log messages. |
known_host_entry |
yes | One or more trusted known_hosts lines to append when missing. |
- You provide the exact trusted
known_hostsline or lines through workflow inputs, usually from a GitHub secret. - The action never contacts the target host to discover keys on its own.
- Empty or unusable input fails fast instead of weakening SSH verification.