gitlab: Only run gitlint on MRs
The gitlint job depends on environment variables, like $CI_MERGE_REQUEST_TARGET_BRANCH_NAME, in order to know how far back to check git commit messages for style. These environment variables are not available outside of a merge request context. GitLab shows the following error when running gitlint, due to the missing environment variable. $ gitlint --commits "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME..$CI_COMMIT_SHA" An error occurred while executing '/usr/bin/git rev-list origin/..c5c91523': b"fatal: ambiguous argument 'origin/..c5c91523': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions, like this:\n'git <command> [<revision>...] -- [<file>...]'" Change the gitlint job to run only in MR context to avoid the above error and run gitlint only where it's useful to do so. Signed-off-by:Jaeden Amero <jaeden.amero@arm.com>
Loading
Please register or sign in to comment