Skip to content

Commit 4c91e03

Browse files
committed
Attempt to use Oath2 token (RELEASEPATCH)
1 parent abcc06b commit 4c91e03

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

pypi.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import json
33
import sys
44
import requests
5-
from pip._internal import commands
65
import subprocess
76

87
# Get the new version number as command line argument
@@ -36,13 +35,12 @@
3635
setup.write(setup_string)
3736

3837
# Draft new release using Github REST API
39-
githubusername = os.environ['GITHUBUSERNAME']
40-
githubpassword = os.environ['GITHUBPASSWORD']
38+
gh_token = os.environ['GH_TOKEN']
4139

4240
release_json = {'tag_name': new_version, 'target_commitish': 'master', 'name': new_version, 'body': '', 'draft': False, 'prerelease': False}
4341

4442
try:
45-
response = requests.post('https://api.github.com/repos/voiceittech/voiceit2-python/releases', auth=(githubusername, githubpassword), data=json.dumps(release_json))
43+
response = requests.post('https://api.github.com/repos/voiceittech/voiceit2-python/releases', headers={'Authorization: token ' + gh_token}, data=json.dumps(release_json))
4644
print(response.text)
4745
except requests.exceptions.HTTPError as e:
4846
print(e.read())

voiceit2/voiceit2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class VoiceIt2:
66
base_URL = 'https://api.voiceit.io'
7-
version = '2.4.1'
7+
version = '2.4.2'
88
voiceit_basic_auth_credentials = ''
99
notification_url = ''
1010

0 commit comments

Comments
 (0)