From b9403398055f36b040ac2c782e43fac55f4add10 Mon Sep 17 00:00:00 2001 From: Mack <11793063+frewmack@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:20:09 -0400 Subject: [PATCH] Trim newlines from ssh agent eval string (#407) --- .github/workflows/node-prod.yml | 4 +++- .github/workflows/node.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node-prod.yml b/.github/workflows/node-prod.yml index 4a8308d5..b4ad1d2c 100644 --- a/.github/workflows/node-prod.yml +++ b/.github/workflows/node-prod.yml @@ -92,8 +92,10 @@ jobs: # # https://docs.docker.com/engine/context/working-with-contexts/ # This avoids passing an -H parameter to every Docker CLI call. + # + # We use `tr` to trim newlines. GITHUB_OUTPUT doesn't like multi-line strings run: | - SSH_AGENT_EVAL=$(ssh-agent -s) + SSH_AGENT_EVAL=$(ssh-agent -s | tr '\012\015' ' '; echo) eval "$SSH_AGENT_EVAL" ssh-add - <<< "${{ secrets.DEPLOY_PRIVATE_KEY }}" echo "ssh-agent-eval=$SSH_AGENT_EVAL" >> $GITHUB_OUTPUT diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index f6612a47..e25071f3 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -137,8 +137,10 @@ jobs: # # https://docs.docker.com/engine/context/working-with-contexts/ # This avoids passing an -H parameter to every Docker CLI call. + # + # We use `tr` to trim newlines. GITHUB_OUTPUT doesn't like multi-line strings run: | - SSH_AGENT_EVAL=$(ssh-agent -s) + SSH_AGENT_EVAL=$(ssh-agent -s | tr '\012\015' ' '; echo) eval "$SSH_AGENT_EVAL" ssh-add - <<< "${{ secrets.DEPLOY_PRIVATE_KEY }}" echo "ssh-agent-eval=$SSH_AGENT_EVAL" >> $GITHUB_OUTPUT