Skip to content

Commit 7f1c7d8

Browse files
committed
wip: finalize repo commit & push
1 parent 26f3db9 commit 7f1c7d8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

adabot/update_cp_org_libraries.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def get_contributors(repo):
107107
today_minus_seven = datetime.datetime.today() - datetime.timedelta(days=7)
108108
prs = result.json()
109109
for pr in prs:
110+
merged_at = datetime.datetime.min
110111
if "merged_at" in pr:
111112
if pr["merged_at"] is None:
112113
continue
@@ -148,12 +149,18 @@ def update_json_file(working_directory, cp_org_dir, output_filename, json_string
148149
os.chdir(cp_org_dir)
149150
git.pull()
150151
git.submodule("update", "--init", "--recursive")
151-
check_branch = git.branch("-r", "--list")
152-
print("branch result:", check_branch.split("\n"))
152+
#check_branch = git.branch("-r", "--list")
153+
#print("branch result:", check_branch.split("\n"))
153154

154155
with open(output_filename, "w") as json_file:
155156
json.dump(json_string, json_file, indent=2)
156157

158+
if "TRAVIS" in os.environ:
159+
commit_day = date.date.strftime(datetime.datetime.today(), "%Y-%m-%d")
160+
commit_msg = "adabot: auto-update of libraries.json ({})".format(commit_day)
161+
git.commit("-a", "-m", commit_msg)
162+
git.push()
163+
157164
if __name__ == "__main__":
158165
cmd_line_args = cmd_line_parser.parse_args()
159166

0 commit comments

Comments
 (0)