I’m using GitHub Actions in CI. When I run commands directly in YAML recipe:
- run: composer install --ansi
the output is colored:
But then when I run the same command inside a bash script:
- run: sh composer-install.sh
# composer-install.sh composer install --ansi
It’s without colors:
How can I propagate the colors through bash script to the CI output?
Advertisement
Answer
To enable colors, include this line in the bash script file:
export TERM=xterm-color
Cherry pick of @KenJackson comment.