Merge pull request #1749 from simonstamm/main

fix(gitlab): trigger when MR changes from draft to ready
This commit is contained in:
Tal
2025-05-08 19:18:53 +03:00
committed by GitHub

View File

@ -86,7 +86,17 @@ def is_draft(data) -> bool:
def is_draft_ready(data) -> bool: def is_draft_ready(data) -> bool:
try: try:
if 'draft' in data.get('changes', {}): if 'draft' in data.get('changes', {}):
if data['changes']['draft']['previous'] == 'true' and data['changes']['draft']['current'] == 'false': # Handle both boolean values and string values for compatibility
previous = data['changes']['draft']['previous']
current = data['changes']['draft']['current']
# Convert to boolean if they're strings
if isinstance(previous, str):
previous = previous.lower() == 'true'
if isinstance(current, str):
current = current.lower() == 'true'
if previous is True and current is False:
return True return True
# for gitlab server version before 16 # for gitlab server version before 16