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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gcp_platforms_auto
3
- Version: 0.6.0
3
+ Version: 0.6.2
4
4
  Summary: A brief description of your package
5
5
  Author-email: ofir4858 <ofirshasha10@gmail.com>
6
6
  License: MIT
@@ -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
- url = f"https://{github_enterprise}/api/v3/orgs/{org}/repos"
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": False
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gcp_platforms_auto
3
- Version: 0.6.0
3
+ Version: 0.6.2
4
4
  Summary: A brief description of your package
5
5
  Author-email: ofir4858 <ofirshasha10@gmail.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "gcp_platforms_auto"
7
- version = "0.6.0"
7
+ version = "0.6.2"
8
8
  description = "A brief description of your package"
9
9
  readme = "README.md"
10
10
  authors = [