Secret detection job fails to run on tags
Problem
In https://gitlab.com/gitlab-org/gitlab-runner/-/jobs/780958582 secret_detection
is failing to run because it's trying to compare a tag
$ git fetch origin $CI_DEFAULT_BRANCH $CI_COMMIT_REF_NAME
From https://gitlab.com/gitlab-org/gitlab-runner
* branch master -> FETCH_HEAD
* tag v13.5.0-rc1 -> 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/v13.5.0-rc1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
/cc @theoretick @zrice
Edited by Steve Xuereb