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.
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 variableBUILD_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:This can be prevented by adding a line of code that removes the problematic environment variable:
unset BUILD_SOURCEVERSIONMESSAGE
before storing the environment intoenv.list
.