Svix

trunk.io Webhook Event Types

This is the list of event types that we currently send.
For guidance on how to listen to these events, take a look at Svix's guide to consuming webhooks.

pull_request.canceled

Triggered when a PR is canceled

Example Pull Request
JSON
{
  "action": "canceled",
  "author": "mmatheson",
  "http_details_url": "https://app.trunk.io/gh/trunk-io/mergequeue/merge/main/8762",
  "pr_number": 1234,
  "repository": {
    "host": "github.com",
    "name": "mergequeue",
    "owner": "trunk-io"
  },
  "status": "canceled",
  "target_branch": "main"
}

pull_request.failed

Triggered when a PR fails while in the merge queue

Example Pull Request
JSON
{
  "action": "failed",
  "author": "mmatheson",
  "failure_reason": "TEST_RUN_REQUIRED_STATUS_FAILED",
  "http_details_url": "https://app.trunk.io/gh/trunk-io/mergequeue/merge/main/8762",
  "pr_number": 1234,
  "repository": {
    "host": "github.com",
    "name": "mergequeue",
    "owner": "trunk-io"
  },
  "status": "failed",
  "target_branch": "main"
}

pull_request.merged

Triggered when a PR is merged

Example Pull Request
JSON
{
  "action": "merged",
  "author": "mmatheson",
  "http_details_url": "https://app.trunk.io/gh/trunk-io/mergequeue/merge/main/8762",
  "pr_number": 1234,
  "repository": {
    "host": "github.com",
    "name": "mergequeue",
    "owner": "trunk-io"
  },
  "status": "merged",
  "target_branch": "main"
}

pull_request.queued

Triggered when a PR has passed any branch protection requirements and is ready to be tested in the merge queue

Example Pull Request
JSON
{
  "action": "queued",
  "author": "mmatheson",
  "http_details_url": "https://app.trunk.io/gh/trunk-io/mergequeue/merge/main/8762",
  "pr_number": 1234,
  "repository": {
    "host": "github.com",
    "name": "mergequeue",
    "owner": "trunk-io"
  },
  "status": "queued",
  "target_branch": "main"
}

pull_request.submitted

Triggered when a PR is submitted to Trunk Merge

Example Pull Request
JSON
{
  "action": "submitted",
  "author": "mmatheson",
  "http_details_url": "https://app.trunk.io/gh/trunk-io/mergequeue/merge/main/8762",
  "pr_number": 1234,
  "repository": {
    "host": "github.com",
    "name": "mergequeue",
    "owner": "trunk-io"
  },
  "status": "submitted",
  "target_branch": "main"
}

pull_request.testing

Triggered when a PR has started testing in the merge queue

Example Pull Request
JSON
{
  "action": "testing",
  "author": "mmatheson",
  "http_details_url": "https://app.trunk.io/gh/trunk-io/mergequeue/merge/main/8762",
  "pr_number": 1234,
  "repository": {
    "host": "github.com",
    "name": "mergequeue",
    "owner": "trunk-io"
  },
  "status": "testing",
  "target_branch": "main"
}

test_case.status_changed

Emitted when the health status of a test case changes. Test status can transition between `healthy`, `flaky`, and `broken`. Learn how test health is detected: https://docs.trunk.io/flaky-tests/detection

Example
JSON
{
  "status_change": {
    "current_status": {
      "reason": " Inconsistent results on main",
      "timestamp": "2024-11-22T20:04:33.127Z",
      "value": "flaky"
    },
    "previous_status": "healthy"
  },
  "test_case": {
    "codeowners": [
      "@backend"
    ],
    "failure_rate_last_7d": 0.1,
    "file_path": "trunk/services/__tests__/distributed_lock.test.js",
    "html_url": "https://app.trunk.io/trunk/flaky-tests/test/77681877-1608-5871-bf95-e02f8baa5a9a?repo=trunk-io%2Fanalytics-cli",
    "id": "2bfedccc-7fda-442c-bcf9-5e01c6d046d3",
    "most_common_failures": [
      {
        "last_occurrence": "2024-11-22T20:04:33.127Z",
        "occurrence_count": 42,
        "summary": "timeout"
      }
    ],
    "name": "DistributedLock #tryLock default throws on double unlock",
    "pull_requests_impacted_last_7d": 42,
    "quarantine": true,
    "repository": {
      "html_url": "https://github.com/trunk-io/analytics-cli"
    },
    "status": {
      "reason": " Inconsistent results on main",
      "timestamp": "2024-11-22T20:04:33.127Z",
      "value": "flaky"
    },
    "test_suite": "DistributedLock",
    "ticket": {
      "html_url": "https://trunk-io.atlassian.net/browse/KAN-130"
    }
  }
}