debricked / templates

CI/CD templates for integrating your repository with Debricked
MIT License
0 stars 7 forks source link

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

Open lsoethout opened 2 years ago

lsoethout commented 2 years ago

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.

esp0 commented 1 year ago

Will this be fixed @viktigpetterr ?