Skip to content

Multiline Output in pre and post Workflow Hook Scripts is not Correctly Formatted #3424

Closed
@X-Guardian

Description

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

If a pre or post workflow hook script writes multiline output, it is not formatted correctly, missing a carriage return at the end of each line.

Reproduction Steps

repos.yaml

repos:
- id: /.*/
  pre_workflow_hooks:
    - run: |
        echo "pre workflow test line 1a" && echo "pre workflow test line 1b"
        echo "pre workflow test line 2a" && echo "pre workflow test line 2b"
  post_workflow_hooks:
    - run: |
        echo "post workflow test line 1a" && echo "post workflow test line 1b"
        echo "post workflow test line 2a" && echo "post workflow test line 2b"

Logs

Logs
{"level":"info","ts":"2023-05-21T15:25:23.051+0100","caller":"runtime/pre_workflow_hook_runner.go:77","msg":"successfully ran \"echo \\\"pre workflow test line 1a\\\" && echo \\\"pre workflow test line 1b\\\"\\necho \\\"pre workflow test line 2a\\\" && echo \\\"pre workflow test line 2b\\\"\\n\" in \"/root/.atlantis/repos/X-Guardian/atlantis-test/1/default\"","json":{"repo":"X-Guardian/atlantis-test","pull":"1"}}
{"level":"info","ts":"2023-05-21T15:25:24.386+0100","caller":"events/project_command_builder.go:399","msg":"found no atlantis.yaml file","json":{"repo":"X-Guardian/atlantis-test","pull":"1"}}
{"level":"info","ts":"2023-05-21T15:25:24.386+0100","caller":"events/project_command_builder.go:403","msg":"automatically determined that there were 0 projects modified in this pull request: []","json":{"repo":"X-Guardian/atlantis-test","pull":"1"}}
{"level":"info","ts":"2023-05-21T15:25:25.641+0100","caller":"runtime/post_workflow_hook_runner.go:77","msg":"successfully ran \"echo \\\"post workflow test line 1a\\\" && echo \\\"post workflow test line 1b\\\"\\necho \\\"post workflow test line 2a\\\" && echo \\\"post workflow test line 2b\\\"\\n\" in \"/root/.atlantis/repos/X-Guardian/atlantis-test/1/default\"","json":{"repo":"X-Guardian/atlantis-test","pull":"1"}}

Output Screenshots

Pre Workflow Hook

image

Post Workflow Hook

image

Environment details

Atlantis version: 0.23.5
Deployment method: local
If not running the latest Atlantis version have you tried to reproduce this issue on the latest version: n/a
Atlantis flags: none
Atlantis server-side config file: none

Additional Context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions