Skip to content

Commit

Permalink
Identify requests from TravisCI website (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eder-K committed Jan 29, 2020
1 parent 72a0bd7 commit b227b2e
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions push.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,20 @@ def create_job_log(test, log, exit_status):

# Decipher commit from the job message
if (event_type == "api"):
job_that_triggered = commit_message.split("Triggered by:")[-1]
if job_that_triggered == "manual script call":
event_type = "manual trigger"

# Check if api request came from triggering script
if ("Triggered by:" in commit_message):
job_that_triggered = commit_message.split("Triggered by:")[-1]
if job_that_triggered == "manual script call":
event_type = "manual trigger"
else:
*_, adapter_name, _, adapter_job_id = job_that_triggered.split('/')
triggered_commit = get_job_commit(adapter_job_id)
event_type = "commit to the {}".format(adapter_name)

# Otherwise request was sent from TravisCI website
else:
*_, adapter_name, _, adapter_job_id = job_that_triggered.split('/')
triggered_commit = get_job_commit(adapter_job_id)
event_type = "commit to the {}".format(adapter_name)
event_type = "website trigger"
else:
triggered_commit = get_job_commit(job_id)

Expand Down

0 comments on commit b227b2e

Please sign in to comment.