Check for master and dev branches being protected
This template is ONLY used for enhancement requests. Bug reporting or new feature request issues should use the other template options for issue submission.
Current Behavior
When a branch is not protected while running on master or development, the failure occurs pretty late in the pipeline, and the error does not provide a good description of what the actual issue is.
Purpose
In the linting stage, it would be nice to be able to check whether master or dev branches are protected and output a proper error message.
Plan
- Attempt to use CI_COMMIT_REF_PROTECTED and CI_COMMIT_REF_NAME to confirm the branch name and if it is protected
- Use rules to end the pipeline at lint and print an error message relevant to the branch not being protected
Acceptance Criteria
- Non-protected master and development branches fail at the lint stage
- Appropriate error message is displayed when branch protection is the reason the pipeline fails
Edited by Kenneth Maguire