Use CI_DEFAULT_BRANCH instead of a hard-coded "master"
Newer projects are using 'main' for their default branch, and hard-coding to "master" limits the use of these CI files in such projects. By using $CI_DEFAULT_BRANCH, the logic should work fine in any project.