Skip to content

Commit 3ed3472

Browse files
authored
Add disable_keyscan Option (#35)
1 parent 08a9cd6 commit 3ed3472

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
[![Workflow Release](https://img.shields.io/github/actions/workflow/status/cssnr/stack-deploy-action/release.yaml?logo=github&label=release)](https://github.com/cssnr/stack-deploy-action/actions/workflows/release.yaml)
55
[![Workflow Test](https://img.shields.io/github/actions/workflow/status/cssnr/stack-deploy-action/test.yaml?logo=github&label=test)](https://github.com/cssnr/stack-deploy-action/actions/workflows/test.yaml)
66
[![Workflow Lint](https://img.shields.io/github/actions/workflow/status/cssnr/stack-deploy-action/lint.yaml?logo=github&label=lint)](https://github.com/cssnr/stack-deploy-action/actions/workflows/lint.yaml)
7-
[![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/stack-deploy-action?logo=github&label=updated)](https://github.com/cssnr/stack-deploy-action/graphs/commit-activity)
7+
[![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/stack-deploy-action?logo=github&label=updated)](https://github.com/cssnr/stack-deploy-action/pulse)
88
[![Codeberg Last Commit](https://img.shields.io/gitea/last-commit/cssnr/stack-deploy-action/master?gitea_url=https%3A%2F%2Fcodeberg.org%2F&logo=codeberg&logoColor=white&label=updated)](https://codeberg.org/cssnr/stack-deploy-action)
9+
[![GitHub Contributors](https://img.shields.io/github/contributors/cssnr/stack-deploy-action)](https://github.com/cssnr/stack-deploy-action/graphs/contributors)
10+
[![GitHub Repo Size](https://img.shields.io/github/repo-size/cssnr/stack-deploy-action?logo=bookstack&logoColor=white&label=size)](https://github.com/cssnr/stack-deploy-action)
911
[![GitHub Top Language](https://img.shields.io/github/languages/top/cssnr/stack-deploy-action?logo=sharp&logoColor=white)](https://github.com/cssnr/stack-deploy-action)
10-
[![GitHub repo size](https://img.shields.io/github/repo-size/cssnr/stack-deploy-action?logo=bookstack&logoColor=white&label=size)](https://github.com/cssnr/stack-deploy-action)
11-
[![GitHub Discussions](https://img.shields.io/github/discussions/cssnr/stack-deploy-action)](https://github.com/cssnr/stack-deploy-action/discussions)
12+
[![GitHub Discussions](https://img.shields.io/github/discussions/cssnr/stack-deploy-action?logo=github)](https://github.com/cssnr/stack-deploy-action/discussions)
1213
[![GitHub Forks](https://img.shields.io/github/forks/cssnr/stack-deploy-action?style=flat&logo=github)](https://github.com/cssnr/stack-deploy-action/forks)
1314
[![GitHub Repo Stars](https://img.shields.io/github/stars/cssnr/stack-deploy-action?style=flat&logo=github)](https://github.com/cssnr/stack-deploy-action/stargazers)
1415
[![GitHub Org Stars](https://img.shields.io/github/stars/cssnr?style=flat&logo=github&label=org%20stars)](https://cssnr.github.io/)
1516
[![Discord](https://img.shields.io/discord/899171661457293343?logo=discord&logoColor=white&label=discord&color=7289da)](https://discord.gg/wXy6m2X8wY)
16-
[![Support](https://img.shields.io/badge/Ko--fi-579fbf?logo=kofi&label=Support)](https://ko-fi.com/cssnr)
17+
[![Ko-fi](https://img.shields.io/badge/Ko--fi-72a5f2?logo=kofi&label=support)](https://ko-fi.com/cssnr)
1718

1819
# Docker Stack Deploy Action
1920

@@ -54,6 +55,7 @@ For more details see [action.yaml](action.yaml) and [src/main.sh](src/main.sh).
5455
| `user` | **Yes** | - | Remote Docker Username |
5556
| `pass` | or `ssh_key` | - | Remote Docker Password \* |
5657
| `ssh_key` | or `pass` | - | Remote SSH Key File \* |
58+
| `disable_keyscan` | - | `false` | Disable SSH Key Scan: `ssh-keyscan` \* |
5759
| `env_file` | - | - | Docker Environment File \* |
5860
| `detach`**²** | - | `true` | Detach Flag, `false`, to disable \* |
5961
| `prune`**²** | - | `false` | Prune Flag, `true`, to enable |
@@ -96,6 +98,8 @@ If your hostname is behind a proxy like Cloudflare you will need to use the IP a
9698

9799
**pass/ssh_key:** You must provide either a `pass` or `ssh_key`, not both.
98100

101+
**disable_keyscan:** This will disable the `ssh-keyscan` command. Advanced use only.
102+
99103
**env_file:** Variables in this file are exported before running stack deploy.
100104
To use a docker `env_file` specify it in your compose file and make it available in a previous step.
101105
If you need compose file templating this can also be done in a previous step.
@@ -502,12 +506,12 @@ For more information, see the CSSNR [SUPPORT.md](https://github.com/cssnr/.githu
502506

503507
# Contributing
504508

509+
If you would like to submit a PR, please review the [CONTRIBUTING.md](CONTRIBUTING.md).
510+
505511
Please consider making a donation to support the development of this project
506512
and [additional](https://cssnr.com/) open source projects.
507513

508-
[![Support](https://img.shields.io/badge/Ko--fi-579fbf?style=for-the-badge&logo=kofi&label=Support)](https://ko-fi.com/cssnr)
509-
510-
If you would like to submit a PR, please review the [CONTRIBUTING.md](CONTRIBUTING.md).
514+
[![Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/cssnr)
511515

512516
Additionally, you can support other GitHub Actions I have published:
513517

@@ -524,4 +528,4 @@ Additionally, you can support other GitHub Actions I have published:
524528
- [Package Changelog Action](https://github.com/cssnr/package-changelog-action?tab=readme-ov-file#readme)
525529
- [NPM Outdated Check Action](https://github.com/cssnr/npm-outdated-action?tab=readme-ov-file#readme)
526530

527-
For a full list of current projects to support visit: [https://cssnr.github.io/](https://cssnr.github.io/)
531+
For a full list of current projects visit: [https://cssnr.github.io/](https://cssnr.github.io/)

action.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ inputs:
3737
ssh_key:
3838
description: "Remote SSH Key File"
3939
required: false
40+
disable_keyscan:
41+
description: "Disable SSH Key Scan"
42+
required: false
4043
env_file:
4144
description: "Environment File"
4245
required: false

src/main.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
set -e
55

6-
# shellcheck disable=SC2317
6+
# shellcheck disable=SC2317,SC2329
77
function cleanup_trap() {
88
_ST="$?"
99
if [[ -z "${INPUT_SSH_KEY}" ]];then
@@ -59,7 +59,11 @@ echo "Deploy Mode: ${INPUT_MODE}"
5959

6060
mkdir -p "${SSH_DIR}" ~/.ssh
6161
chmod 0700 "${SSH_DIR}" ~/.ssh
62-
ssh-keyscan -p "${INPUT_PORT}" -H "${INPUT_HOST}" >> "${SSH_DIR}/known_hosts"
62+
63+
if [[ "${INPUT_DISABLE_KEYSCAN}" != "true" ]];then
64+
echo "Running: ssh-keyscan"
65+
ssh-keyscan -p "${INPUT_PORT}" -H "${INPUT_HOST}" >> "${SSH_DIR}/known_hosts"
66+
fi
6367
echo "::endgroup::"
6468

6569
## Setup Authentication

0 commit comments

Comments
 (0)