Trying to retrieve latest commit in main branch before the new head.
But using CI_COMMIT_BEFORE_SHA
its returning always zero's. In case, if I run pipeline from the GitLab UI.
It working fine if its trigged automatically in case of a push to main branch.
Pipline Custome Variables using Predefined Gitlab CI variables:--
- NX_HEAD=$CI_COMMIT_SHA
- NX_BASE=${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA}