Merge pull request #303 from rowan-vr/302-commit-branch

Allow selection for another branch than the default ones
This commit is contained in:
Anmol Singh
2022-08-21 08:16:57 +05:30
committed by GitHub
3 changed files with 8 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
INPUT_WAKATIME_API_KEY="" INPUT_WAKATIME_API_KEY=""
INPUT_PUSH_BRANCH_NAME="main"
INPUT_SHOW_TIMEZONE="True" INPUT_SHOW_TIMEZONE="True"
INPUT_SHOW_PROJECTS="False" INPUT_SHOW_PROJECTS="False"
INPUT_SHOW_EDITORS="False" INPUT_SHOW_EDITORS="False"

View File

@@ -12,6 +12,11 @@ inputs:
description: 'Your Wakatime API Key' description: 'Your Wakatime API Key'
required: true required: true
PUSH_BRANCH_NAME:
required: false
description: "The branch to update the readme in"
default: "master"
SHOW_OS: SHOW_OS:
required: false required: false
description: 'Show the list of OS Worked on In dev metrics' description: 'Show the list of OS Worked on In dev metrics'

View File

@@ -30,6 +30,7 @@ listReg = f"{START_COMMENT}[\\s\\S]+{END_COMMENT}"
waka_key = os.getenv('INPUT_WAKATIME_API_KEY') waka_key = os.getenv('INPUT_WAKATIME_API_KEY')
ghtoken = os.getenv('INPUT_GH_TOKEN') ghtoken = os.getenv('INPUT_GH_TOKEN')
branchName = os.getenv('INPUT_PUSH_BRANCH_NAME')
showTimeZone = os.getenv('INPUT_SHOW_TIMEZONE') showTimeZone = os.getenv('INPUT_SHOW_TIMEZONE')
showProjects = os.getenv('INPUT_SHOW_PROJECTS') showProjects = os.getenv('INPUT_SHOW_PROJECTS')
showEditors = os.getenv('INPUT_SHOW_EDITORS') showEditors = os.getenv('INPUT_SHOW_EDITORS')
@@ -574,7 +575,7 @@ if __name__ == '__main__':
if new_readme != rdmd: if new_readme != rdmd:
try: try:
repo.update_file(path=contents.path, message=commit_message, repo.update_file(path=contents.path, message=commit_message,
content=new_readme, sha=contents.sha, branch='master', content=new_readme, sha=contents.sha, branch=branchName,
committer=committer) committer=committer)
except: except:
repo.update_file(path=contents.path, message=commit_message, repo.update_file(path=contents.path, message=commit_message,