Skip to content

type MergeMethod only support lowercase which is conflicted with github API #3558

Description

@stanfordpeng

Check the GitHub API:

Image

The merge_queue.merge_method only supports the upper case: MERGE, SQUASH, REBASE

However, in the code the enum is in lower case, which easily mislead users to pass in the enum in lowercase. I have tested from my side, lower case will cause GitHub server return an error directly:
https://github.com/google/go-github/blob/v71.0.0/github/rules.go#L106

Note: I understand for other type of rulesets, it requires lowercase again which is an issue of GitHub API. They should have made case consistent 🤦 :

Image
go-github should still make things clearer: add uppercase enum and comments about when to use lowercase and not.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions