Fix scheduled events issue
This commit is contained in:
parent
facb42d776
commit
580fc69c02
1 changed files with 10 additions and 2 deletions
|
@ -15,6 +15,10 @@ def get_github_event(github_event_path):
|
||||||
|
|
||||||
|
|
||||||
def ignore_event(github_event):
|
def ignore_event(github_event):
|
||||||
|
if 'schedule' in github_event:
|
||||||
|
print("Allow schedule event.")
|
||||||
|
return False
|
||||||
|
|
||||||
# Ignore push events on deleted branches
|
# Ignore push events on deleted branches
|
||||||
# The event we want to ignore occurs when a PR is created but the repository owner decides
|
# The event we want to ignore occurs when a PR is created but the repository owner decides
|
||||||
# not to commit the changes. They close the PR and delete the branch. This creates a
|
# not to commit the changes. They close the PR and delete the branch. This creates a
|
||||||
|
@ -39,8 +43,12 @@ def pr_branch_exists(repo, branch):
|
||||||
|
|
||||||
|
|
||||||
def get_head_author(github_event):
|
def get_head_author(github_event):
|
||||||
email = "{head_commit[author][email]}".format(**github_event)
|
if 'schedule' in github_event:
|
||||||
name = "{head_commit[author][name]}".format(**github_event)
|
email=os.environ['GITHUB_ACTOR']
|
||||||
|
name=os.environ['GITHUB_ACTOR'] + '@users.noreply.github.com'
|
||||||
|
else
|
||||||
|
email = "{head_commit[author][email]}".format(**github_event)
|
||||||
|
name = "{head_commit[author][name]}".format(**github_event)
|
||||||
return email, name
|
return email, name
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue