Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identify requests from TravisCI website #165

Merged
merged 1 commit into from
Jan 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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