Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pre-release' into labels
Browse files Browse the repository at this point in the history
  • Loading branch information
slacrherbst committed Mar 17, 2020
2 parents 6076fe2 + a2f3e2f commit 2c58960
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
17 changes: 12 additions & 5 deletions releaseGen.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,12 +525,19 @@ def pushRelease(cfg, relName, relData, ver, tagAttach, prev):

print("\nLogging into github....\n")

if args.token is None:
print("Enter your github token. If you do no have one you can generate it here:");
print(" https://github.com/settings/tokens");
token = input("\nGithub token: ");
else:
if args.token is not None:
print("Using github token from command line arg.")
token = args.token
else:
token = os.environ.get('GITHUB_TOKEN')

if token is None:
print("Enter your github token. If you do no have one you can generate it here:");
print(" https://github.com/settings/tokens");
print("You may set it in your environment as GITHUB_TOKEN")
token = input("\nGithub token: ");
else:
print("Using github token from user's environment.")

gh = github.Github(token)
remRepo = gh.get_repo(f'slaclab/{project}')
Expand Down
13 changes: 12 additions & 1 deletion releaseNotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def getReleaseNotes(locRepo, remRepo, tagRange, noSort=False):
import pyperclip
from getpass import getpass
import re
import os

import git # https://gitpython.readthedocs.io/en/stable/tutorial.html
from github import Github # https://pygithub.readthedocs.io/en/latest/introduction.html
Expand Down Expand Up @@ -181,7 +182,17 @@ def getReleaseNotes(locRepo, remRepo, tagRange, noSort=False):
project = re.compile(r'slaclab/(?P<name>.*?).git').search(url).group('name')

# Connect to the Git server
token = input("Enter your github token: ")
token = os.environ.get('GITHUB_TOKEN')

if token is None:
print("Enter your github token. If you do no have one you can generate it here:");
print(" https://github.com/settings/tokens");
print("You may set it in your environment as GITHUB_TOKEN")
token = input("\nGithub token: ");

else:
print("Using github token from user's environment.")

github = Github(token)

# Get the repo information
Expand Down

0 comments on commit 2c58960

Please sign in to comment.