Skip to content

Commit

Permalink
sahil-sagwekar2652#10 Adding an argument for 'description' of the Git…
Browse files Browse the repository at this point in the history
…Hub repository sahil-sagwekar2652#46

sahil-sagwekar2652#10 sahil-sagwekar2652#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"
  • Loading branch information
ashvaneetk committed May 23, 2023
1 parent 5c28641 commit ed58e4b
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions scripts/create_repo
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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',
Expand Down

0 comments on commit ed58e4b

Please sign in to comment.