Skip to content

Commit

Permalink
Trim newlines from ssh agent eval string (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
frewmack authored Jun 4, 2024
1 parent 0a0a0e4 commit b940339
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/node-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b940339

Please sign in to comment.