Error defining new ENV-VAR from command


i am trying to define an ENV VAR from git command, so i get this:

  - run:
      name: Set modules list to test
      command: |
        echo \'export MODULES=$(git show --name-only --format= | cut -d/ -f1 | sort | uniq | xargs | sed 's/ /,/g' | sed 's/.circleci/base/g')\' >> $BASH_ENV
        source $BASH_ENV

so i got command not found for my var, in gist all my command and error output:

is not clear for me why run as command if am just define de var, so i guess source $BASH_ENV is running it.