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' default: '22'
runs: runs:
using: 'docker' using: 'docker'
image: 'docker://liy36/ubuntu-ssh:24.04'
steps: steps:
- run: | - name: Run SSH Command
mkdir -p ~/.ssh/ uses: docker://liy36/ubuntu-ssh:24.04
echo "${{ inputs.key }}" > ~/.ssh/id_rsa with:
chmod 600 ~/.ssh/id_rsa entrypoint: /bin/bash
ssh -o StrictHostKeyChecking=no -p ${{ inputs.port }} ${{ inputs.user }}@${{ inputs.host }} "${{ inputs.command }}" 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 }}\"'"