Skip to content

Fix for #42 - allowing multiline K8S_SECRET_ CI variables

As noted in #42 (closed) - CI variables with the prefix K8S_SECRET do not work with linebreaks. This is due to this line of code:

env | sed -n "s/^K8S_SECRET_\(.*\)$/\1/p" >k8s_prefixed_variables

env will also have linebreaks between variables, making it indistinguishable from line breaks in the content. My thinking with this solution, was to get all ENV variables that are prefixed with K8S_SECRET_, iterate over them and append them to the output. the K8S_SECRET_ is then removed.

This is very much a hack - I'm sure someone has a more elegant way of doing this.

Edited by 🤖 GitLab Bot 🤖

Merge request reports