Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions gwh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ def index():
labels = helpers.get_label_names(gl.get_labels(project_id))
list_labels = helpers.get_list_labels(gl.get_boards(project_id))
for commit in payload['commits']:
parse_commit = helpers.parse_commit_labels(commit['message'])
parse_commit = helpers.parse_commit_labels(commit['message'], labels)
for issue in parse_commit['issues']:
issue_labels = gl.get_issue(project_id, issue)
updated_labels = helpers.simplify_labels(issue_labels, parse_commit['label_ops'])
issue_json = gl.get_issue(project_id, issue)
existing_labels = helpers.get_issue_labels(issue_json)
updated_labels = helpers.simplify_labels(existing_labels, parse_commit, list_labels)
gl.set_issue_labels(project_id, issue, updated_labels)
return 'OK'

2 changes: 1 addition & 1 deletion gwh/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def simplify_labels(self, existing, from_message, board_labels = None):
labels = existing
for ops in from_message['label_ops']:
op = ops[0]
name = ops[1].decode('utf-8')
name = ops[1]
if op == '+':
labels.append(name)
if op == '-':
Expand Down
Loading