diff --git a/.gitignore b/.gitignore index 99909574..bad46e6a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ # builded *-build.json + +.github_credentials diff --git a/list_builder.py b/list_builder.py index e1fc7ad6..077fbe4f 100755 --- a/list_builder.py +++ b/list_builder.py @@ -20,6 +20,10 @@ re_commit_author = re.compile( re.MULTILINE ) +# GitHub credentials from ./.github_credentials than should contain : +# For example: foobar:abcdef1234567890 +github_credentials = open("./.github_credentials").read().strip().split(":") + # Helpers @@ -72,7 +76,7 @@ def get_json(url, verify=True): try: # Retrieve and load manifest if ".github" in url: - r = requests.get(url, verify=verify, auth=token) + r = requests.get(url, verify=verify, auth=github_credentials) else: r = requests.get(url, verify=verify) r.raise_for_status() @@ -106,7 +110,6 @@ parser = argparse.ArgumentParser(description='Process YunoHost application list. # Add arguments and options parser.add_argument("input", help="Path to json input file") parser.add_argument("-o", "--output", help="Path to result file. If not specified, '-build' suffix will be added to input filename.") -parser.add_argument("-g", "--github", help="Github token :") # Parse args args = parser.parse_args() @@ -133,12 +136,6 @@ if os.path.exists(args.output): except Exception as e: print("Error while trying to load already built file: %s" % e) -# GitHub credentials -if args.github: - token = (args.github.split(':')[0], args.github.split(':')[1]) -else: - token = None - # Loop through every apps result_dict = {} for app, info in apps_list.items():