INNER CODE UNIT · Python
train_labels
IvanMurzak/Unity-MCP · .github/scripts/chain_feed.py:664
def train_labels(payload):
labels = ((payload.get("pull_request") or {}).get("labels")) or []
out = []
for label in labels:
name = label.get("name") if isinstance(label, dict) else str(label)
if name and str(name).startswith(TRAIN_LABEL_PREFIX):
out.append(str(name))
return out
def extract_fenced_lock(body):
"""The ```chain-lock fenced JSON block of a PR body, or `None`.
Deliberately a scan for the fence rather than a regex over the whole body: a train PR body
is prose written by a human and may contain other fenced blocks.
"""
if not body:
return None