kopia lustrzana https://github.com/Langenfeld/py-gitea
set up repository with predefined issue labels
rodzic
e1b499599d
commit
e9d45515d9
|
@ -74,3 +74,4 @@ Tests can be run with:
|
||||||
```python3 -m pytest test_api.py```
|
```python3 -m pytest test_api.py```
|
||||||
|
|
||||||
Make sure to have a gitea-instance running on `http://localhost:3000`, and an admin-user token at `.token`.
|
Make sure to have a gitea-instance running on `http://localhost:3000`, and an admin-user token at `.token`.
|
||||||
|
The admin user must be named ``test``, with email ``secondarytest@test.org``.
|
||||||
|
|
|
@ -697,7 +697,7 @@ class Gitea:
|
||||||
return user
|
return user
|
||||||
|
|
||||||
def create_repo(self, repoOwner, repoName: str, description: str = "", private: bool = False, autoInit=True,
|
def create_repo(self, repoOwner, repoName: str, description: str = "", private: bool = False, autoInit=True,
|
||||||
gitignores=None, license=None, readme="Default", ):
|
gitignores:str=None, license:str=None, readme:str="Default", issue_labels:str=None ):
|
||||||
""" Create a Repository.
|
""" Create a Repository.
|
||||||
Throws:
|
Throws:
|
||||||
AlreadyExistsException, if Repository exists already.
|
AlreadyExistsException, if Repository exists already.
|
||||||
|
@ -711,7 +711,7 @@ class Gitea:
|
||||||
Gitea.ADMIN_REPO_CREATE % repoOwner.username, data={"name": repoName, "description": description,
|
Gitea.ADMIN_REPO_CREATE % repoOwner.username, data={"name": repoName, "description": description,
|
||||||
"private": private, "auto_init": autoInit,
|
"private": private, "auto_init": autoInit,
|
||||||
"gitignores": gitignores, "license": license,
|
"gitignores": gitignores, "license": license,
|
||||||
"readme": readme})
|
"issue_labels": issue_labels, "readme": readme})
|
||||||
if "id" in result:
|
if "id" in result:
|
||||||
self.logger.info("Successfully created Repository %s " % result["name"])
|
self.logger.info("Successfully created Repository %s " % result["name"])
|
||||||
else:
|
else:
|
||||||
|
|
Ładowanie…
Reference in New Issue