Skip to content

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

@fredvd

Description

@fredvd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions