Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

13 linesCodeBlameRaw
1-- Work items: runs that issues and their comments started name the events
2-- that start them now, `work_item` and `work_item_comment`, and their
3-- payload (`info.event`) has the item in `work_item`, where `issue` was.
4-- A workflow's listed events stay as its file names them: a file that
5-- still says `issues` starts nothing until it says `work_item`.
6UPDATE runs
7SET info = json_remove(json_set(info, '$.event.work_item', json(json_extract(info, '$.event.issue'))), '$.event.issue')
8WHERE event IN ('issues', 'issue_comment') AND json_type(info, '$.event.issue') IS NOT NULL;
9
10UPDATE runs
11SET event = CASE event WHEN 'issues' THEN 'work_item' ELSE 'work_item_comment' END,
12 info = json_set(info, '$.eventName', CASE event WHEN 'issues' THEN 'work_item' ELSE 'work_item_comment' END)
13WHERE event IN ('issues', 'issue_comment');