Skip to content

github go library needs updating to support new custom_properties type #2518

@carcunha

Description

@carcunha

I created a custom property at my organization and set it on a few repos, and then started seeing this on digger workflows:

level=ERROR msg="Failed to parse GitHub context. error parsing GitHub context JSON: json: cannot unmarshal array into Go struct field Repository.repository.custom_properties of type string"

I chatted with cursor, and got this reasoning:

The issue is in the UnmarshalJSON method in models.go. When parsing GitHub events (lines 60-83), it unmarshals into github.PullRequestEvent, github.IssueCommentEvent, etc. from github.com/google/go-github/v55/github. These event types include a Repository struct from the go-github library, which defines custom_properties as a string, but GitHub now returns it as an array.

I see that go-github is currently at v80, and v55 is from september 2023, so this probably needs updating.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions