From 633db55f50f79f5cb08d4a7f73d57f2ca57958f1 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 18 Aug 2023 20:56:50 +0000 Subject: [PATCH] ci: set file mode early in `appveyor_docker.yml` Also: - replace tab with spaces in generated config file - formatting Cherry-picked from #1175 --- .github/workflows/appveyor_docker.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/appveyor_docker.yml b/.github/workflows/appveyor_docker.yml index 2b2c8183..6729ce7b 100644 --- a/.github/workflows/appveyor_docker.yml +++ b/.github/workflows/appveyor_docker.yml @@ -52,18 +52,17 @@ jobs: - name: Setup SSH client configuration run: | cd ~ - mkdir .ssh - chmod 0700 .ssh - echo "ServerAliveInterval 45" > .ssh/config - echo "Host ${{ github.event.inputs.ssh_host }}" >> .ssh/config - echo "${{ github.event.inputs.ssh_forward }}" | sed 's/,/\n/g' | sed 's/^/\tRemoteForward /g' >> .ssh/config - chmod 0600 .ssh/config - cat .ssh/config - echo "${{ github.event.inputs.ssh_host }} ${{ github.event.inputs.ssh_hostkey }}" | sed 's/,/\n${{ github.event.inputs.ssh_host }} /g' > .ssh/known_hosts - chmod 0600 .ssh/known_hosts - cat .ssh/known_hosts - echo "${{ github.event.inputs.ssh_privkey }}" | sed 's/,/\n/g' > .ssh/id_rsa - chmod 0600 .ssh/id_rsa + mkdir -m 0700 .ssh + install -m 0600 /dev/null .ssh/config + { + echo 'ServerAliveInterval 45' + echo 'Host ${{ github.event.inputs.ssh_host }}' + echo '${{ github.event.inputs.ssh_forward }}' | sed 's/,/\n/g' | sed 's/^/ RemoteForward /g' + } | tee -a .ssh/config + install -m 0600 /dev/null .ssh/known_hosts + echo '${{ github.event.inputs.ssh_host }} ${{ github.event.inputs.ssh_hostkey }}' | sed 's/,/\n${{ github.event.inputs.ssh_host }} /g' | tee -a .ssh/known_hosts + install -m 0600 /dev/null .ssh/id_rsa + echo '${{ github.event.inputs.ssh_privkey }}' | sed 's/,/\n/g' >> .ssh/id_rsa # we sleep explicitly to allow the remote system to kill the sleep process - name: Connect to AppVeyor and sleep