Skip to content

[BUG]: The JSON value could not be converted to Octokit.Webhooks.Events.MergeGroupEvent #755

@cliffchapmanrbx

Description

@cliffchapmanrbx

What happened?

Looks like the merge_group event has a new action, destroyed, and an accompanying reason field: https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=destroyed#merge_group

Example exception

System.Text.Json.JsonException: The JSON value could not be converted to Octokit.Webhooks.Events.MergeGroupEvent. Path: $ | LineNumber: 0 | BytePositionInLine: 8633.
   at Octokit.Webhooks.Converter.WebhookConverter`1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo`1 jsonTypeInfo)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
...(user code)...

Example sanitized webhook headers:

// Request URL: https://service.example.com/webhook/event
// Request method: POST
// Accept: */*
// Content-Type: application/json
// User-Agent: GitHub-Hookshot/ae0acdc
// X-GitHub-Delivery: 452fe7a0-8cfc-11f0-887a-c18e3d8d0dcf
// X-GitHub-Enterprise-Host: github.example.com
// X-GitHub-Enterprise-Version: 3.14.10
// X-GitHub-Event: merge_group
// X-GitHub-Hook-ID: 29506
// X-GitHub-Hook-Installation-Target-ID: 124
// X-GitHub-Hook-Installation-Target-Type: integration
// X-Hub-Signature: sha1=509244a67aa3c206bac48eb28299017ff2f518fa
// X-Hub-Signature-256: sha256=3a994009684eb33361654725e6ad6eaf4e9256ef73e55ee39f9ee08e0a6232b5

Example sanitized payload, note that the signatures won't match:

{
  "action": "destroyed",
  "merge_group": {
    "head_sha": "e26bd29e4fe9a8373d704d3cd25bb08c83b6a6b4",
    "head_ref": "refs/heads/gh-readonly-queue/master/pr-3089-686be27e553fcc593f8ddb139c8b539ebbd1f273",
    "base_sha": "686be27e553fcc593f8ddb139c8b539ebbd1f273",
    "base_ref": "refs/heads/master",
    "head_commit": {
      "id": "e26bd29e4fe9a8373d704d3cd25bb08c83b6a6b4",
      "tree_id": "7951796ca031eed56c3cf96cd9777483a04acc8d",
      "message": "scale up price attributes (#3089)",
      "timestamp": "2025-09-08T21:38:44Z",
      "author": {
        "name": "Some Person",
        "email": "[email protected]"
      },
      "committer": {
        "name": "GitHub Enterprise",
        "email": "[email protected]"
      }
    }
  },
  "reason": "merged",
  "repository": {
    // Nothing surprising here
  },
  "organization": {
    // Nothing surprising here
  },
  "enterprise": {
    // Nothing surprising here
  },
  "sender": {
    // Nothing surprising here
  },
  "installation": {
    "id": 464,
    "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNDY0"
  }
}

Versions

Octokit.Webhooks.AspNetCore v3.0.0
.NET 8

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    Status

    🆕 Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions