MCPcopy Create free account
hub / github.com/simstudioai/sim / isAzureDevOpsEventMatch

Function isAzureDevOpsEventMatch

apps/sim/triggers/azure_devops/utils.ts:45–72  ·  view source on GitHub ↗
(triggerId: string, body: Record<string, unknown>)

Source from the content-addressed store, hash-verified

43 * Returns whether an Azure DevOps service hook payload matches the configured trigger.
44 */
45export function isAzureDevOpsEventMatch(triggerId: string, body: Record<string, unknown>): boolean {
46 if (triggerId === 'azure_devops_webhook') {
47 return true
48 }
49
50 const eventType = body.eventType as string | undefined
51
52 if (triggerId === 'azure_devops_build_failed') {
53 if (eventType !== AZURE_DEVOPS_BUILD_FAILED_EVENT) {
54 return false
55 }
56 const resource = body.resource as Record<string, unknown> | undefined
57 const result = (resource?.result as string | undefined)?.toLowerCase()
58 return (
59 result === 'failed' ||
60 result === 'canceled' ||
61 result === 'cancelled' ||
62 result === 'stopped' ||
63 result === 'partiallysucceeded'
64 )
65 }
66
67 if (triggerId === 'azure_devops_work_item_created') {
68 return eventType === AZURE_DEVOPS_WORK_ITEM_CREATED_EVENT
69 }
70
71 return false
72}
73
74export function buildBuildFailedOutputs(): Record<string, TriggerOutput> {
75 return {

Callers 2

matchEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected