Skip to content

Commit a5f292c

Browse files
Add default branch to repository edit event (#2995)
Fixes: #2994.
1 parent 78c6de0 commit a5f292c

File tree

3 files changed

+44
-5
lines changed

3 files changed

+44
-5
lines changed

github/event_types.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,12 @@ type GollumEvent struct {
388388
// EditChange represents the changes when an issue, pull request, comment,
389389
// or repository has been edited.
390390
type EditChange struct {
391-
Title *EditTitle `json:"title,omitempty"`
392-
Body *EditBody `json:"body,omitempty"`
393-
Base *EditBase `json:"base,omitempty"`
394-
Repo *EditRepo `json:"repository,omitempty"`
395-
Owner *EditOwner `json:"owner,omitempty"`
391+
Title *EditTitle `json:"title,omitempty"`
392+
Body *EditBody `json:"body,omitempty"`
393+
Base *EditBase `json:"base,omitempty"`
394+
Repo *EditRepo `json:"repository,omitempty"`
395+
Owner *EditOwner `json:"owner,omitempty"`
396+
DefaultBranch *EditDefaultBranch `json:"default_branch,omitempty"`
396397
}
397398

398399
// EditTitle represents a pull-request title change.
@@ -442,6 +443,11 @@ type EditSHA struct {
442443
From *string `json:"from,omitempty"`
443444
}
444445

446+
// EditDefaultBranch represents a change of repository's default branch name.
447+
type EditDefaultBranch struct {
448+
From *string `json:"from,omitempty"`
449+
}
450+
445451
// ProjectChange represents the changes when a project has been edited.
446452
type ProjectChange struct {
447453
Name *ProjectName `json:"name,omitempty"`

github/github-accessors.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)