Skip to content

Commit ab428ec

Browse files
committed
feat: add ssh-keyless-login action
1 parent d6315f5 commit ab428ec

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: SSH Copy ID
2+
description: Configure SSH keyless login to target hosts
3+
4+
inputs:
5+
target_hosts:
6+
description: 'Comma-separated list of target hosts'
7+
required: true
8+
password:
9+
description: 'SSH login password'
10+
required: true
11+
12+
runs:
13+
using: 'composite'
14+
steps:
15+
- name: Install sshpass
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install -y sshpass
19+
20+
- name: Copy SSH Key to Target Hosts
21+
shell: bash
22+
run: |
23+
IFS=',' read -r -a hosts <<< "${{ inputs.target_hosts }}"
24+
for host in "${hosts[@]}"; do
25+
echo "Copying SSH key to $host"
26+
sshpass -p "${{ inputs.password }}" ssh-copy-id -o StrictHostKeyChecking=no root@$host
27+
done

.github/workflows/gen-taostest-env.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: Update Hosts
22

3-
on:
4-
push:
5-
branches:
6-
- test/fractal
73
# on:
8-
# workflow_dispatch:
4+
# push:
5+
# branches:
6+
# - test/fractal
7+
on:
8+
workflow_dispatch:
99

1010
jobs:
1111
filter-runners:

0 commit comments

Comments
 (0)