diff --git a/requirements.txt b/requirements.txt index c0459e2..eff2d98 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ cffi==1.3.0 cryptography==1.0.2 enum34==1.0.4 --e git+https://github.com/ryanpitts/github3.py.git@74c4c5338606a89b794a1052046969995fa83336#egg=github3.py-origin/develop +github3.py==0.9.4 gspread==0.2.5 httplib2==0.9.2 idna==2.0 diff --git a/update_mozfest_schedule.py b/update_mozfest_schedule.py index 501a508..8f74a11 100644 --- a/update_mozfest_schedule.py +++ b/update_mozfest_schedule.py @@ -296,7 +296,7 @@ def commit_json(data, target_config=GITHUB_CONFIG, commit=COMMIT_JSON_TO_GITHUB) repo = gh.repository(target_config['REPO_OWNER'], target_config['REPO_NAME']) # check to see whether data file exists - contents = repo.file_contents( + contents = repo.contents( path=target_config['TARGET_FILE'], ref=target_config['TARGET_BRANCH'] ) @@ -312,9 +312,11 @@ def commit_json(data, target_config=GITHUB_CONFIG, commit=COMMIT_JSON_TO_GITHUB) ) else: # update existing file - contents.update( + repo.update_file( + path=target_config['TARGET_FILE'], message='updating session data', content=data, + sha=contents.sha, branch=GITHUB_CONFIG['TARGET_BRANCH'] )