kitconcept / docker-stack-deploy

GitHub Action and Docker image used to deploy a Docker stack on a Docker Swarm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If remote_host has a newline, deployment fails with ssh: Could not resolve hostname

fredvd opened this issue · comments

This is an easy error to make and hard to catch. Only if you enable debug on the run, you see that the remote_host variable only has a starting ' quote, but not an ending quote like the other variables.

In the github environment UI it is very easy and invisible if the variable has a newline. Can we add somethiing like:

https://stackoverflow.com/questions/19345872/how-to-remove-a-newline-from-a-string-in-bash

when the remote_host variable is used?

Alternatively we could also catch it in the GHA workflow file when the remote_host variable is assigned in the with: arguments, but that's repetitive boiler plate every time you use the action.