in lib/release_tools/monthly/finalize/update_protected_branches.rb [17:48]
def execute
PROJECTS.each do |project|
logger.info('Unprotecting previous stable branch', branch: old_branch(ee: project.ee_branch?), project: project)
logger.info('Protecting current stable branch', branch: current_branch(ee: project.ee_branch?), project: project)
next if SharedStatus.dry_run?
Retriable.with_context(:api) do
client.unprotect_branch(project, old_branch(ee: project.ee_branch?))
end
Retriable.with_context(:api) do
client.protect_branch(
project,
current_branch(ee: project.ee_branch?),
merge_access_level: MAINTAINER_ACCESS_LEVEL,
allowed_to_merge: allowed_to_merge,
allowed_to_push: allowed_to_push,
code_owner_approval_required: false
)
end
end
send_slack_notification(:success)
rescue StandardError => ex
logger.fatal(error_message, error: ex)
send_slack_notification(:failed)
raise
end