SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 3fd48da0 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

add unprotecting branch step to git repo creation

parent 74254455
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ from common.utils import get_current_domain
from gitlab import Gitlab
from gitlab.v4.objects import Group, Project
from gitlab.exceptions import GitlabGetError
from gitlab.const import AccessLevel
import arxiv
import requests
......@@ -148,6 +149,17 @@ class Command(BaseCommand):
}
)
# Unprotect "main" branch to allow developers to push to it
project.protectedbranches.delete("main")
project.protectedbranches.create(
{
"name": "main",
"merge_access_level": AccessLevel.MAINTAINER,
"push_access_level": AccessLevel.DEVELOPER,
"allow_force_push": False,
}
)
self.stdout.write(
self.style.SUCCESS(f"Created git repository at {repo.git_path}")
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment