From ed58e4b0da088a69b27974f7920dc006f8edf0e2 Mon Sep 17 00:00:00 2001 From: ashvaneetk <123331072+ashvaneetk@users.noreply.github.com> Date: Tue, 23 May 2023 09:46:21 +0530 Subject: [PATCH] #10 Adding an argument for 'description' of the GitHub repository #46 #10 #46 Adding an argument for 'description' of the GitHub repository . Check the 'payload' variable to modify the value for the "description" key. The value for the "description" key in the payload variable has been changed to "Added new scripts for data processing and bug fixes" --- scripts/create_repo | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/scripts/create_repo b/scripts/create_repo index 9d3c5fa..234d0ea 100644 --- a/scripts/create_repo +++ b/scripts/create_repo @@ -11,23 +11,18 @@ if not GITHUB_API_TOKEN: URL = "https://api.github.com/user/repos" -parser = argparse.ArgumentParser(description='creates a local repository linked with a remote repository') -parser.add_argument('path', - metavar='PATH', - type=str, +parser = argparse.ArgumentParser(description='creates a local repository linked with a remote repository') # noqa: E501 + +parser.add_argument('path', + metavar='PATH', + type=str, help='Enter the path for the new repository') -parser.add_argument('name', - metavar='NAME', - type=str, +parser.add_argument('name', + metavar='NAME', + type=str, help='Enter a name for the new repository') -parser.add_argument('-d', - '--description', - metavar='DESCRIPTION', - type=str, - help='Enter a description for the new repository') args = parser.parse_args() - name = args.name path = args.path @@ -42,8 +37,9 @@ os.system('git add . && git commit -m "initial commit"') conn = http.client.HTTPSConnection("api.github.com") payload = json.dumps({ "name": name, - "description": "made with the GitHub API" + "description": "This is a modified description" # Modify the value here }) + headers = { 'Authorization': f'Bearer {GITHUB_API_TOKEN}', 'Content-Type': 'application/json',