Only run secrets detection job form merge requests
This job tries to compare the current commit to master:
$ git fetch origin $CI_DEFAULT_BRANCH $CI_COMMIT_REF_NAME
From https://gitlab.com/gitlab-org/gitlab-pages
* branch master -> FETCH_HEAD
* tag v1.29.0 -> FETCH_HEAD
$ git log --left-right --cherry-pick --pretty=format:"%H" refs/remotes/origin/$CI_DEFAULT_BRANCH...refs/remotes/origin/$CI_COMMIT_REF_NAME > "$CI_COMMIT_SHA"_commit_list.txt
fatal: ambiguous argument 'refs/remotes/origin/master...refs/remotes/origin/v1.29.0': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
So it doesn't make sense to run it for anything but merge requests.
Closes #499 (closed)
Edited by Vladimir Shushlin