gcp-platforms-auto 0.6.0__tar.gz → 0.6.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/PKG-INFO +1 -1
- {gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/gcp_platforms_auto/git.py +9 -4
- {gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/gcp_platforms_auto.egg-info/PKG-INFO +1 -1
- {gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/pyproject.toml +1 -1
- {gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/README.md +0 -0
- {gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/gcp_platforms_auto/__init__.py +0 -0
- {gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/gcp_platforms_auto.egg-info/SOURCES.txt +0 -0
- {gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/gcp_platforms_auto.egg-info/dependency_links.txt +0 -0
- {gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/gcp_platforms_auto.egg-info/requires.txt +0 -0
- {gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/gcp_platforms_auto.egg-info/top_level.txt +0 -0
- {gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/setup.cfg +0 -0
|
@@ -90,7 +90,13 @@ def git_push(repo, commit_message, files_to_push=None):
|
|
|
90
90
|
def create_repo(org, repo, token, github_enterprise="github.com"):
|
|
91
91
|
try:
|
|
92
92
|
logger.info("Creating repository...")
|
|
93
|
-
|
|
93
|
+
is_github_cloud = github_enterprise is "github.com"
|
|
94
|
+
api_base = (
|
|
95
|
+
"https://api.github.com"
|
|
96
|
+
if is_github_cloud else f"https://{github_enterprise}/api/v3"
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
url = f"{api_base}/orgs/{org}/repos"
|
|
94
100
|
headers = {
|
|
95
101
|
"Authorization": f"token {token}",
|
|
96
102
|
"Accept": "application/vnd.github+json"
|
|
@@ -98,7 +104,7 @@ def create_repo(org, repo, token, github_enterprise="github.com"):
|
|
|
98
104
|
data = {
|
|
99
105
|
"name": repo,
|
|
100
106
|
"private": True,
|
|
101
|
-
"auto_init":
|
|
107
|
+
"auto_init": True
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
res = requests.post(url, headers=headers, json=data)
|
|
@@ -110,5 +116,4 @@ def create_repo(org, repo, token, github_enterprise="github.com"):
|
|
|
110
116
|
|
|
111
117
|
except Exception as e:
|
|
112
118
|
logger.exception(f"Error creating repository: {str(e)}")
|
|
113
|
-
raise e
|
|
114
|
-
|
|
119
|
+
raise e
|
|
File without changes
|
|
File without changes
|
{gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/gcp_platforms_auto.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/gcp_platforms_auto.egg-info/requires.txt
RENAMED
|
File without changes
|
{gcp_platforms_auto-0.6.0 → gcp_platforms_auto-0.6.2}/gcp_platforms_auto.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|