Skip to content

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

@stanfordpeng

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions