action.yml: add status messages for better user insight

This commit is contained in:
Oystein Kristoffer Tveit 2024-05-01 14:14:46 +02:00
parent cb05b550f9
commit 21c9eb7fa1
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
1 changed files with 10 additions and 1 deletions

View File

@ -43,18 +43,22 @@ runs:
then
echo "rsync is already installed"
else
echo "Updating package index"
apt-get update
echo "Installing rsync"
apt-get install -y rsync
fi
shell: bash
- name: Create SSH directory
run: |
echo "Creating ~/.ssh"
mkdir -p ~/.ssh
shell: bash
- name: Install SSH config
run: |
echo "Installing SSH config"
echo <<EOF > ~/.ssh/config
Host targethost
User ${{ inputs.username }}
@ -68,6 +72,7 @@ runs:
- name: Install SSH known_hosts
run: |
echo "Installing known_hosts"
echo "${{ inputs.known-host-content }}" > ~/.ssh/known_hosts
echo " StrictHostKeyChecking yes" >> ~/.ssh/config
shell: bash
@ -75,6 +80,7 @@ runs:
- name: Disable SSH host key checking
run: |
echo "Disabling host key checking"
echo " StrictHostKeyChecking no" >> ~/.ssh/config
shell: bash
if: ${{ inputs.known-host-content == null }}
@ -82,11 +88,14 @@ runs:
- name: Install SSH key
run: |
echo "Installing SSH key"
echo "${{ inputs.ssh-key }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
shell: bash
if: ${{ inputs.ssh-key != null }}
- name: Transfer files
run: rsync ${{ inputs.args }} "${{ inputs.source }}" "targethost:${{ inputs.target }}"
run: |
echo "Transferring files"
rsync ${{ inputs.args }} "${{ inputs.source }}" "targethost:${{ inputs.target }}"
shell: bash