nbroad HF staff commited on
Commit
e5bb1f7
1 Parent(s): 6e89539

ignore private repos

Browse files
Files changed (1) hide show
  1. update.py +10 -10
update.py CHANGED
@@ -92,7 +92,7 @@ async def process_webhook(request):
92
 
93
  if payload["repo"]["type"] == "model":
94
 
95
- if "discussion" not in payload or payload["discussion"]["isPullRequest"]:
96
  return {"status": "skipped"}, 200
97
 
98
  changing_status = "comment" not in payload and payload["event"]["action"] == "update"
@@ -217,16 +217,16 @@ def update_webhooks():
217
  else:
218
  to_add.append({"name": m.id, "type": "org"})
219
 
220
- new_watched = webhook2update[0].watched + to_add
221
 
222
- print("There are now", len(new_watched), "items in the watched list")
223
 
224
- api.update_webhook(
225
- webhook_id=id2update,
226
- url=webhook_url,
227
- watched=new_watched,
228
- domains=["discussion"],
229
- secret=WEBHOOK_SECRET,
230
- )
231
 
232
 
 
92
 
93
  if payload["repo"]["type"] == "model":
94
 
95
+ if "discussion" not in payload or payload["discussion"]["isPullRequest"] or payload["repo"]["private"]:
96
  return {"status": "skipped"}, 200
97
 
98
  changing_status = "comment" not in payload and payload["event"]["action"] == "update"
 
217
  else:
218
  to_add.append({"name": m.id, "type": "org"})
219
 
220
+ new_watched = webhook2update[0].watched + to_add
221
 
222
+ print("There are now", len(new_watched), "items in the watched list")
223
 
224
+ api.update_webhook(
225
+ id=id2update,
226
+ url=webhook_url,
227
+ watched=new_watched,
228
+ domains=["discussion"],
229
+ secret=WEBHOOK_SECRET,
230
+ )
231
 
232