mirror of
https://github.com/storytold/autocraft.git
synced 2026-12-01 10:33:55 +01:00
Forced re-reads upsert comments in place; only completed check suites queue a re-read
This commit is contained in:
1 parent
cc02c10ba5
commit
33244fca28
4 files changed
+30
-8
No files matched your search
@@ -31,7 +31,7 @@ function trackedName(db: DatabaseSync, payload: Obj): string | null {
|
||||
}
|
||||
|
||||
/**
|
||||
* The item numbers an event names. A check event counts when it completes and names the pull requests of its head;
|
||||
* The item numbers an event names. A completed check suite counts and names the pull requests of its head;
|
||||
* GitHub lists none for a fork's pull request, so the head commit is matched to this repository's open pull requests.
|
||||
*/
|
||||
export function itemNumbers(db: DatabaseSync, repo: string, event: string, payload: Obj): number[] {
|
||||
@@ -42,9 +42,8 @@ export function itemNumbers(db: DatabaseSync, repo: string, event: string, paylo
|
||||
case "pull_request":
|
||||
case "pull_request_review":
|
||||
case "pull_request_review_comment": return one(obj(payload.pull_request).number);
|
||||
case "check_suite":
|
||||
case "check_run": {
|
||||
const body = obj(payload[event]);
|
||||
case "check_suite": {
|
||||
const body = obj(payload.check_suite);
|
||||
if (payload.action !== "completed") return [];
|
||||
const repoId = obj(payload.repository).id;
|
||||
const listed = Array.isArray(body.pull_requests) ? body.pull_requests : [];
|
||||
|
||||
Reference in new issue
Block a user