MCPcopy Create free account
hub / github.com/FastLED/FastLED / main

Function main

ci/github_project_sync.py:298–328  ·  view source on GitHub ↗

Entry point: parse config, sync item to project, set status and date.

()

Source from the content-addressed store, hash-verified

296
297
298def main() -> None:
299 """Entry point: parse config, sync item to project, set status and date."""
300 config = Config.from_env()
301
302 if not config.project_owner:
303 raise SystemExit("PROJECT_OWNER is required")
304
305 print(f"Looking up project: {config.project_owner}#{config.project_number}")
306 project_id = find_project(
307 config.project_owner, config.project_owner_type, config.project_number
308 )
309 print(f"Project ID: {project_id}")
310
311 print(f"Adding item {config.item_node_id} to project")
312 item_id = add_item_to_project(project_id, config.item_node_id)
313 print(f"Project item ID: {item_id}")
314
315 status_name = determine_status(config)
316 print(f"Setting status to: {status_name}")
317 resolved = get_field_and_option(project_id, config.status_field, status_name)
318 update_single_select(project_id, item_id, resolved.field_id, resolved.option_id)
319 print("Status updated")
320
321 if config.date_field and config.event_action in ("opened", "ready_for_review"):
322 today = datetime.now(timezone.utc).strftime("%Y-%m-%d")
323 print(f"Setting {config.date_field} to {today}")
324 date_field_id = get_date_field(project_id, config.date_field)
325 update_date(project_id, item_id, date_field_id, today)
326 print("Date updated")
327
328 print("Done")
329
330
331if __name__ == "__main__":

Callers 1

Calls 10

find_projectFunction · 0.85
add_item_to_projectFunction · 0.85
determine_statusFunction · 0.85
get_field_and_optionFunction · 0.85
update_single_selectFunction · 0.85
get_date_fieldFunction · 0.85
update_dateFunction · 0.85
from_envMethod · 0.80
printFunction · 0.50
nowMethod · 0.45

Tested by

no test coverage detected