Skip to content

Commit 4dba7a4

Browse files
committed
Prevent pure download auto-tally from causing releases
1 parent b417f43 commit 4dba7a4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

adabot/circuitpython_bundle.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ def update_bundle(bundle_path):
285285
status = StringIO()
286286
git.status("--short", _out=status)
287287
updates = []
288+
release_required = False
288289
status = status.getvalue().strip()
289290
if status:
290291
for status_line in status.split("\n"):
@@ -305,6 +306,7 @@ def update_bundle(bundle_path):
305306
url = repo_remote_url(directory)
306307
summary = "\n".join(diff_lines[1:-1])
307308
updates.append((url[:-4], old_commit, new_commit, summary))
309+
release_required = True
308310
os.chdir(working_directory)
309311
lib_list_updates = check_lib_links_md(bundle_path)
310312
if lib_list_updates:
@@ -321,6 +323,7 @@ def update_bundle(bundle_path):
321323
),
322324
)
323325
)
326+
release_required = True
324327
if update_download_stats(bundle_path):
325328
updates.append(
326329
(
@@ -334,7 +337,7 @@ def update_bundle(bundle_path):
334337
)
335338
)
336339

337-
return updates
340+
return updates, release_required
338341

339342

340343
def commit_updates(bundle_path, update_info):
@@ -546,9 +549,9 @@ def new_release(bundle, bundle_path):
546549
bundle_dir = os.path.join(bundles_dir, cp_bundle)
547550
try:
548551
fetch_bundle(cp_bundle, bundle_dir)
549-
updates_needed = update_bundle(bundle_dir)
550-
if updates_needed:
551-
commit_updates(bundle_dir, updates_needed)
552+
updates, release_required = update_bundle(bundle_dir)
553+
if release_required:
554+
commit_updates(bundle_dir, updates)
552555
push_updates(bundle_dir)
553556
new_release(cp_bundle, bundle_dir)
554557
except RuntimeError as e:

0 commit comments

Comments
 (0)