mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-23 08:31:29 +00:00
feat: add formatters for workflow_job, status, deployment, ping
This commit is contained in:
parent
fc2e2c2efa
commit
1fc3991332
6 changed files with 292 additions and 6 deletions
|
|
@ -48,6 +48,14 @@ function extractBranch(event: WebhookEvent): string | undefined {
|
|||
const suite = event.payload.check_suite as { head_branch?: string } | undefined;
|
||||
return suite?.head_branch;
|
||||
}
|
||||
if (event.event === "workflow_job") {
|
||||
const job = event.payload.workflow_job as { head_branch?: string } | undefined;
|
||||
return job?.head_branch;
|
||||
}
|
||||
if (event.event === "deployment") {
|
||||
const deployment = event.payload.deployment as { ref?: string } | undefined;
|
||||
return deployment?.ref?.replace("refs/heads/", "");
|
||||
}
|
||||
if (event.event === "commit_comment") {
|
||||
const comment = event.payload.comment as { position?: number | null } | undefined;
|
||||
if (comment?.position != null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue