not-lain commited on
Commit
8f20ebc
·
1 Parent(s): f520416

better logs

Browse files
Files changed (1) hide show
  1. src/gradio_space_ci/webhook.py +6 -6
src/gradio_space_ci/webhook.py CHANGED
@@ -283,18 +283,18 @@ async def trigger_ci_on_pr(payload: WebhookPayload, task_queue: BackgroundTasks)
283
  # Found a PR that is not yet synced
284
  task_queue.add_task(sync_ci_space, space_id=space_id, pr_num=discussion.num)
285
  has_task = True
286
- elif (
287
- # Comment on an open pr by trusted_authors
288
  payload.event.scope == "discussion.comment"
289
  and payload.event.action == "create"
290
  and payload.discussion.isPullRequest
291
  and payload.discussion.status == "open"
292
  # TODO:
293
- # this is limited to the owner only switch to trusted_authors
294
- and payload.discussion.author.id == payload.repo.owner
295
  ):
296
- print("Payload by owner detected with content:\n ", payload.comment.content)
297
-
 
298
  if has_task:
299
  return Response("Task scheduled to sync/delete Space", status_code=status.HTTP_202_ACCEPTED)
300
  else:
 
283
  # Found a PR that is not yet synced
284
  task_queue.add_task(sync_ci_space, space_id=space_id, pr_num=discussion.num)
285
  has_task = True
286
+ if (
 
287
  payload.event.scope == "discussion.comment"
288
  and payload.event.action == "create"
289
  and payload.discussion.isPullRequest
290
  and payload.discussion.status == "open"
291
  # TODO:
292
+ # figure out how to get the username from the id
293
+ # and payload.discussion.author.id in EPHEMERAL_SPACES_CONFIG["trusted_authors"]
294
  ):
295
+ print("Comment detected with content:\n ", payload.comment.content)
296
+
297
+
298
  if has_task:
299
  return Response("Task scheduled to sync/delete Space", status_code=status.HTTP_202_ACCEPTED)
300
  else: