Tput error message when using | (pipe) in bash scripts


In Gitlab CI, when I use “|” inside a script, I always have an error message:

tput: No value for $TERM and no -T specified

For example, using the following statement, I will get 3 error messages:

USERNAME="$(cat app/config/parameters.yml | grep 'smartbox.rabbitmq.username: ' | cut -d ':' -f2- | xargs)";

I tried to assign a dummy value for $TERM, but did not work…
Any idea?
Thank you.

I finally found a solution…
would not work, but
export TERM=dumb