Add skip_ignore arg to ignore_event function
During testing, I found it useful to have this function skipped so I added a simple check for SKIP_IGNORE env variable
This commit is contained in:
parent
014d447f0c
commit
fcc56736a6
1 changed files with 4 additions and 3 deletions
|
@ -15,8 +15,8 @@ def get_github_event(github_event_path):
|
||||||
return github_event
|
return github_event
|
||||||
|
|
||||||
|
|
||||||
def ignore_event(event_name, event_data):
|
def ignore_event(event_name, event_data, skip_ignore):
|
||||||
if event_name == "push":
|
if event_name == "push" and not skip_ignore:
|
||||||
# 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
|
||||||
|
@ -122,7 +122,8 @@ def process_event(event_name, event_data, repo, branch, base):
|
||||||
event_name = os.environ['GITHUB_EVENT_NAME']
|
event_name = os.environ['GITHUB_EVENT_NAME']
|
||||||
event_data = get_github_event(os.environ['GITHUB_EVENT_PATH'])
|
event_data = get_github_event(os.environ['GITHUB_EVENT_PATH'])
|
||||||
# Check if this event should be ignored
|
# Check if this event should be ignored
|
||||||
if not ignore_event(event_name, event_data):
|
skip_ignore_event = bool(os.environ.get('SKIP_IGNORE'))
|
||||||
|
if not ignore_event(event_name, event_data, skip_ignore_event):
|
||||||
# Set the repo to the working directory
|
# Set the repo to the working directory
|
||||||
repo = Repo(os.getcwd())
|
repo = Repo(os.getcwd())
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue