Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/gitpod-protocol/src/webhook-event.ts
2498 views
1
/**
2
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
3
* Licensed under the GNU Affero General Public License (AGPL).
4
* See License.AGPL.txt in the project root for license information.
5
*/
6
7
export interface WebhookEvent {
8
id: string;
9
creationTime: string;
10
type: "push" | string;
11
12
/**
13
* Typically the webhook installer is referenced here.
14
*/
15
authorizedUserId?: string;
16
17
/**
18
* webhook event's payload
19
*/
20
rawEvent: string;
21
22
/**
23
* The general status of the received webhook event.
24
*/
25
status: WebhookEvent.Status;
26
27
/**
28
* Optional message to help understand errors with handling events.
29
*/
30
message?: string;
31
32
/**
33
* If the webhook event is considered to trigger a prebuild, the `prebuildStatus`
34
* contains a more specific status.
35
*/
36
prebuildStatus?: WebhookEvent.PrebuildStatus;
37
38
/**
39
* If `prebuildStatus` is `prebuild_triggered` this points to a prebuild.
40
*/
41
prebuildId?: string;
42
43
projectId?: string;
44
45
cloneUrl?: string;
46
47
branch?: string;
48
49
commit?: string;
50
}
51
52
export namespace WebhookEvent {
53
export type Status = "received" | "dismissed_unauthorized" | "ignored" | "processed";
54
export type PrebuildStatus = "ignored_unconfigured" | "prebuild_trigger_failed" | "prebuild_triggered";
55
}
56
57