autoupdate-app-sources: always run in dry-run mode by default, even when running on the entire catalog
This commit is contained in:
parent
9b8f8b78aa
commit
44e9734e72
1 changed files with 8 additions and 6 deletions
|
@ -9,7 +9,7 @@ import glob
|
||||||
|
|
||||||
STRATEGIES = ["latest_github_release", "latest_github_tag", "latest_github_commit"]
|
STRATEGIES = ["latest_github_release", "latest_github_tag", "latest_github_commit"]
|
||||||
|
|
||||||
if len(sys.argv) >= 2:
|
if "--commit-and-create-PR" not in sys.argv:
|
||||||
dry_run = True
|
dry_run = True
|
||||||
else:
|
else:
|
||||||
dry_run = False
|
dry_run = False
|
||||||
|
@ -106,9 +106,9 @@ def sha256_of_remote_file(url):
|
||||||
|
|
||||||
|
|
||||||
class AppAutoUpdater:
|
class AppAutoUpdater:
|
||||||
def __init__(self, app_id):
|
def __init__(self, app_id, app_id_is_local_app_dir=False):
|
||||||
|
|
||||||
if dry_run:
|
if app_id_is_local_app_dir:
|
||||||
if not os.path.exists(app_id + "/manifest.toml"):
|
if not os.path.exists(app_id + "/manifest.toml"):
|
||||||
raise Exception("manifest.toml doesnt exists?")
|
raise Exception("manifest.toml doesnt exists?")
|
||||||
# app_id is in fact a path
|
# app_id is in fact a path
|
||||||
|
@ -346,7 +346,7 @@ class AppAutoUpdater:
|
||||||
else:
|
else:
|
||||||
auth = (GITHUB_LOGIN, GITHUB_TOKEN)
|
auth = (GITHUB_LOGIN, GITHUB_TOKEN)
|
||||||
|
|
||||||
r = requests.get(f"https://api.github.com/{uri}", auth=None)
|
r = requests.get(f"https://api.github.com/{uri}", auth=auth)
|
||||||
assert r.status_code == 200, r
|
assert r.status_code == 200, r
|
||||||
return r.json()
|
return r.json()
|
||||||
|
|
||||||
|
@ -403,8 +403,10 @@ def progressbar(it, prefix="", size=60, file=sys.stdout):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
if len(sys.argv) >= 2:
|
args = [arg for arg in sys.argv[1:] if arg != "--commit-and-create-PR"]
|
||||||
AppAutoUpdater(sys.argv[1]).run()
|
|
||||||
|
if len(args):
|
||||||
|
AppAutoUpdater(args[0], app_id_is_local_app_dir=True).run()
|
||||||
else:
|
else:
|
||||||
for app in progressbar(apps_to_run_auto_update_for(), "Checking: ", 40):
|
for app in progressbar(apps_to_run_auto_update_for(), "Checking: ", 40):
|
||||||
AppAutoUpdater(app).run()
|
AppAutoUpdater(app).run()
|
||||||
|
|
Loading…
Reference in a new issue