gcp-platforms-auto 0.6.2__py3-none-any.whl → 0.6.4__py3-none-any.whl

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/git.py CHANGED
@@ -63,7 +63,7 @@ def get_repo(path_of_git_repo, branch="main", path_to_local_repo="/tmp/repo"):
63
63
  raise e
64
64
 
65
65
 
66
- def git_push(repo, commit_message, files_to_push=None):
66
+ def git_push(repo, commit_message, files_to_push=None, branch="main"):
67
67
  try:
68
68
  logger.info(f"Attempting to push changes to Git with commit message: '{commit_message}'")
69
69
  if files_to_push:
@@ -74,13 +74,13 @@ def git_push(repo, commit_message, files_to_push=None):
74
74
  repo.git.add(all=True)
75
75
  logger.info(f"Committing changes with message: '{commit_message}'")
76
76
  repo.index.commit(commit_message)
77
- logger.info("Pushing changes to remote 'origin'")
78
- push_info = repo.remote(name="origin").push()
77
+ logger.info(f"Pushing changes to remote 'origin', branch '{branch}'")
78
+ push_info = repo.remote(name="origin").push(refspec=f"{branch}:{branch}")
79
79
  for info in push_info:
80
- if info.flags >0:
81
- logger.info(f"Git push info: {info.summary}")
82
- if info.flags == 0:
83
- logger.info(f"Git push info: No update {info.summary}")
80
+ if info.flags > 0:
81
+ logger.info(f"Git push info: {info.summary}")
82
+ elif info.flags == 0:
83
+ logger.info(f"Git push info: No update {info.summary}")
84
84
 
85
85
  logger.info("Successfully pushed changes to Git.")
86
86
  except Exception as e:
@@ -104,7 +104,8 @@ def create_repo(org, repo, token, github_enterprise="github.com"):
104
104
  data = {
105
105
  "name": repo,
106
106
  "private": True,
107
- "auto_init": True
107
+ "auto_init": True,
108
+ "description": repo
108
109
  }
109
110
 
110
111
  res = requests.post(url, headers=headers, json=data)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gcp_platforms_auto
3
- Version: 0.6.2
3
+ Version: 0.6.4
4
4
  Summary: A brief description of your package
5
5
  Author-email: ofir4858 <ofirshasha10@gmail.com>
6
6
  License: MIT
@@ -0,0 +1,6 @@
1
+ gcp_platforms_auto/__init__.py,sha256=7CmPCQxUqAvZTHKCREhL2b4MKD8Pn7FnKZUcMxYC09g,92
2
+ gcp_platforms_auto/git.py,sha256=5eh4xqPwrjdYEDhK3mPM0G6-mQsvm6dhZ2kD80yoxI8,4178
3
+ gcp_platforms_auto-0.6.4.dist-info/METADATA,sha256=fe_Amei_SerPTmc6sDwP74LZh3MCoq1lRC-cuojFyg4,494
4
+ gcp_platforms_auto-0.6.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
+ gcp_platforms_auto-0.6.4.dist-info/top_level.txt,sha256=4q-ofPMmvBaTnIbAzs-Wp_OwheAVxxmJ1fW9vl3-kyE,19
6
+ gcp_platforms_auto-0.6.4.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- gcp_platforms_auto/__init__.py,sha256=7CmPCQxUqAvZTHKCREhL2b4MKD8Pn7FnKZUcMxYC09g,92
2
- gcp_platforms_auto/git.py,sha256=bRkpP64J1FKmKtIhGAh5EloZxCpxVDuwN2V8Ne9rKZA,4067
3
- gcp_platforms_auto-0.6.2.dist-info/METADATA,sha256=GPZx-p-P-8KqPQ7JJCN5_r2Is6itoMbiubDylmLiS7s,494
4
- gcp_platforms_auto-0.6.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
- gcp_platforms_auto-0.6.2.dist-info/top_level.txt,sha256=4q-ofPMmvBaTnIbAzs-Wp_OwheAVxxmJ1fW9vl3-kyE,19
6
- gcp_platforms_auto-0.6.2.dist-info/RECORD,,