Verified Commit a808f56d authored by A. Wilcox's avatar A. Wilcox 🦊
Browse files

GitLab: Skip pending and running pipeline statuses

parent c57f7288
......@@ -3,6 +3,8 @@ import asyncio
from emily.core import push_event, merge_event, pipe_event
from emily.protocols.http import http_handle, HTTPProtocol
SKIP_PIPE = ('pending', 'running',)
class GitLab:
""" Processes information from GitLab Web Hooks. """
......@@ -53,6 +55,8 @@ class GitLab:
return True
elif json['object_kind'] == 'pipeline':
if json['object_attributes'].get('status', 'pending') in SKIP_PIPE:
return True
pipe_info = {}
pipe_info['branch'] = json['object_attributes'].get('ref', 'Unknown')
pipe_info['status'] = json['object_attributes'].get('status')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment