Know range of commit SHAs for MR on CI

Hi, I'm trying to implement commitlint as a script step on .gitlab-ci.yml to check the format of all commit messages in a single MR. I wasn't able to find any relevant env vars available to CI jobs that'd allow me to infer the list of commits in a given MR. I was looking to find something similar to the way Travis exposes a commit range through $TRAVIS_COMMIT_RANGE.

Is this currently possible on GitlabCI? All ideas appreciated. Thank you very much!

Edited by Nicolás A. Fantone