CI: Job "lint-submods-branch" unreliable
Example (one of dozens): https://gitlab.haskell.org/ghc/ghc/-/jobs/1207163
Problems with the job:
- A command within a command substitution fails; the error gets swallowed by bash
- The command fails because it uses CI_COMMIT_BEFORE_SHA as input to
git rev-list
, and that var has an invalid value if the pipeline is the first for a MR.
While it would be nice to fix 1, it's probably sufficient to fix 2.
CI_COMMIT_BEFORE_SHA: The previous latest commit present on a branch or tag. Is always 0000000000000000000000000000000000000000 in merge request pipelines and for the first commit in pipelines for branches or tags.
https://docs.gitlab.com/ee/ci/variables/predefined_variables.html