This commit is contained in:
xRain 2024-07-03 05:41:52 +08:00
parent e1ba563b20
commit 2567dd0379

View File

@ -20,10 +20,9 @@ inputs:
default: '22'
runs:
using: 'docker'
image: 'docker://liy36/ubuntu-ssh:24.04'
steps:
- run: |
mkdir -p ~/.ssh/
echo "${{ inputs.key }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh -o StrictHostKeyChecking=no -p ${{ inputs.port }} ${{ inputs.user }}@${{ inputs.host }} "${{ inputs.command }}"
- name: Run SSH Command
uses: docker://liy36/ubuntu-ssh:24.04
with:
entrypoint: /bin/bash
args: "-c 'mkdir -p ~/.ssh/ && echo \"${{ inputs.key }}\" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa && ssh -o StrictHostKeyChecking=no -p ${{ inputs.port }} ${{ inputs.user }}@${{ inputs.host }} \"${{ inputs.command }}\"'"