It is often handy to have job running on main branch, but allow for manual exectution on other branches. How to do it?
You can use rules:if:
my-job:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: always
- when: manual # otherwise run manually