I would like to define a variable in Gitlab's CI/CD pipeline (.gitlab-ci.yml) in this spirit:
variables:
- TOP_DIR=$(git rev-parse --show-toplevel)
But this doesn't work, I think because the value field must be an actual string. Any workaround? Should I just create a preliminary job that does export TOP_DIR=$(git rev-parse --show-toplevel)?