curl --request POST --header "PRIVATE-TOKEN: ${ACCESS_TOKEN}" "${CI_API_V4_URL}/projects/${CI_MERGE_REQUEST_PROJECT_ID}/protected_branches?name=${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
# Do not protect branch until creation and update of merge request can be differenciated for triggering pipeline, otherwise branch is protected_branches
# with a single update of a merge request (which is not desired). This should be run only for a creation of merge request
# Protect branch:
# stage: generation
# when: on_success
# needs: ["Word CR"]
# only:
# - merge_requests
# script:
# - |
# curl --request POST --header "PRIVATE-TOKEN: ${ACCESS_TOKEN}" "${CI_API_V4_URL}/projects/${CI_MERGE_REQUEST_PROJECT_ID}/protected_branches?name=${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"