You could store the result in a var first:result="EXTRA_DESCRIPTION=$(npx ts-node ./scripts/changelog.ts $CI_COMMIT_TAG)" && echo $result >> variables.env