Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

azure-pipelines.yml will fail for multi-line commit messages #3

Description

@lsoethout

When running an Azure DevOps pipeline that calls azure-pipelines.yml by a manual trigger after a commit has been done through a Pull Request, the environment variable BUILD_SOURCEVERSIONMESSAGE will likely contain a multi-line text with one or more whitespace characters (the description of the commit).

This will lead to additional lines in file env.list that will be interpreted by docker as additional environment variables. This leads to the following error message, ending the pipeline process:

docker: poorly formatted environment: variable 'Second line of commit description.' contains whitespaces.
See 'docker run --help'.
##[debug]Exit code 125 received from tool '/usr/bin/bash'
##[debug]STDIO streams have closed for tool '/usr/bin/bash'
##[error]Bash exited with code '125'.

This can be prevented by adding a line of code that removes the problematic environment variable:
unset BUILD_SOURCEVERSIONMESSAGE
before storing the environment into env.list.

Activity

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

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