Skip to content

Commit fe77322

Browse files
authored
Add custom properties on Repository and PushEventRepository (#3065)
Fixes: #3064.
1 parent e574cdf commit fe77322

File tree

4 files changed

+127
-89
lines changed

4 files changed

+127
-89
lines changed

github/event_types.go

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,43 +1327,44 @@ func (h HeadCommit) String() string {
13271327

13281328
// PushEventRepository represents the repo object in a PushEvent payload.
13291329
type PushEventRepository struct {
1330-
ID *int64 `json:"id,omitempty"`
1331-
NodeID *string `json:"node_id,omitempty"`
1332-
Name *string `json:"name,omitempty"`
1333-
FullName *string `json:"full_name,omitempty"`
1334-
Owner *User `json:"owner,omitempty"`
1335-
Private *bool `json:"private,omitempty"`
1336-
Description *string `json:"description,omitempty"`
1337-
Fork *bool `json:"fork,omitempty"`
1338-
CreatedAt *Timestamp `json:"created_at,omitempty"`
1339-
PushedAt *Timestamp `json:"pushed_at,omitempty"`
1340-
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
1341-
Homepage *string `json:"homepage,omitempty"`
1342-
PullsURL *string `json:"pulls_url,omitempty"`
1343-
Size *int `json:"size,omitempty"`
1344-
StargazersCount *int `json:"stargazers_count,omitempty"`
1345-
WatchersCount *int `json:"watchers_count,omitempty"`
1346-
Language *string `json:"language,omitempty"`
1347-
HasIssues *bool `json:"has_issues,omitempty"`
1348-
HasDownloads *bool `json:"has_downloads,omitempty"`
1349-
HasWiki *bool `json:"has_wiki,omitempty"`
1350-
HasPages *bool `json:"has_pages,omitempty"`
1351-
ForksCount *int `json:"forks_count,omitempty"`
1352-
Archived *bool `json:"archived,omitempty"`
1353-
Disabled *bool `json:"disabled,omitempty"`
1354-
OpenIssuesCount *int `json:"open_issues_count,omitempty"`
1355-
DefaultBranch *string `json:"default_branch,omitempty"`
1356-
MasterBranch *string `json:"master_branch,omitempty"`
1357-
Organization *string `json:"organization,omitempty"`
1358-
URL *string `json:"url,omitempty"`
1359-
ArchiveURL *string `json:"archive_url,omitempty"`
1360-
HTMLURL *string `json:"html_url,omitempty"`
1361-
StatusesURL *string `json:"statuses_url,omitempty"`
1362-
GitURL *string `json:"git_url,omitempty"`
1363-
SSHURL *string `json:"ssh_url,omitempty"`
1364-
CloneURL *string `json:"clone_url,omitempty"`
1365-
SVNURL *string `json:"svn_url,omitempty"`
1366-
Topics []string `json:"topics,omitempty"`
1330+
ID *int64 `json:"id,omitempty"`
1331+
NodeID *string `json:"node_id,omitempty"`
1332+
Name *string `json:"name,omitempty"`
1333+
FullName *string `json:"full_name,omitempty"`
1334+
Owner *User `json:"owner,omitempty"`
1335+
Private *bool `json:"private,omitempty"`
1336+
Description *string `json:"description,omitempty"`
1337+
Fork *bool `json:"fork,omitempty"`
1338+
CreatedAt *Timestamp `json:"created_at,omitempty"`
1339+
PushedAt *Timestamp `json:"pushed_at,omitempty"`
1340+
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
1341+
Homepage *string `json:"homepage,omitempty"`
1342+
PullsURL *string `json:"pulls_url,omitempty"`
1343+
Size *int `json:"size,omitempty"`
1344+
StargazersCount *int `json:"stargazers_count,omitempty"`
1345+
WatchersCount *int `json:"watchers_count,omitempty"`
1346+
Language *string `json:"language,omitempty"`
1347+
HasIssues *bool `json:"has_issues,omitempty"`
1348+
HasDownloads *bool `json:"has_downloads,omitempty"`
1349+
HasWiki *bool `json:"has_wiki,omitempty"`
1350+
HasPages *bool `json:"has_pages,omitempty"`
1351+
ForksCount *int `json:"forks_count,omitempty"`
1352+
Archived *bool `json:"archived,omitempty"`
1353+
Disabled *bool `json:"disabled,omitempty"`
1354+
OpenIssuesCount *int `json:"open_issues_count,omitempty"`
1355+
DefaultBranch *string `json:"default_branch,omitempty"`
1356+
MasterBranch *string `json:"master_branch,omitempty"`
1357+
Organization *string `json:"organization,omitempty"`
1358+
URL *string `json:"url,omitempty"`
1359+
ArchiveURL *string `json:"archive_url,omitempty"`
1360+
HTMLURL *string `json:"html_url,omitempty"`
1361+
StatusesURL *string `json:"statuses_url,omitempty"`
1362+
GitURL *string `json:"git_url,omitempty"`
1363+
SSHURL *string `json:"ssh_url,omitempty"`
1364+
CloneURL *string `json:"clone_url,omitempty"`
1365+
SVNURL *string `json:"svn_url,omitempty"`
1366+
Topics []string `json:"topics,omitempty"`
1367+
CustomProperties map[string]string `json:"custom_properties,omitempty"`
13671368
}
13681369

13691370
// PushEventRepoOwner is a basic representation of user/org in a PushEvent payload.

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: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/repos.go

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -27,58 +27,59 @@ type RepositoriesService service
2727

2828
// Repository represents a GitHub repository.
2929
type Repository struct {
30-
ID *int64 `json:"id,omitempty"`
31-
NodeID *string `json:"node_id,omitempty"`
32-
Owner *User `json:"owner,omitempty"`
33-
Name *string `json:"name,omitempty"`
34-
FullName *string `json:"full_name,omitempty"`
35-
Description *string `json:"description,omitempty"`
36-
Homepage *string `json:"homepage,omitempty"`
37-
CodeOfConduct *CodeOfConduct `json:"code_of_conduct,omitempty"`
38-
DefaultBranch *string `json:"default_branch,omitempty"`
39-
MasterBranch *string `json:"master_branch,omitempty"`
40-
CreatedAt *Timestamp `json:"created_at,omitempty"`
41-
PushedAt *Timestamp `json:"pushed_at,omitempty"`
42-
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
43-
HTMLURL *string `json:"html_url,omitempty"`
44-
CloneURL *string `json:"clone_url,omitempty"`
45-
GitURL *string `json:"git_url,omitempty"`
46-
MirrorURL *string `json:"mirror_url,omitempty"`
47-
SSHURL *string `json:"ssh_url,omitempty"`
48-
SVNURL *string `json:"svn_url,omitempty"`
49-
Language *string `json:"language,omitempty"`
50-
Fork *bool `json:"fork,omitempty"`
51-
ForksCount *int `json:"forks_count,omitempty"`
52-
NetworkCount *int `json:"network_count,omitempty"`
53-
OpenIssuesCount *int `json:"open_issues_count,omitempty"`
54-
OpenIssues *int `json:"open_issues,omitempty"` // Deprecated: Replaced by OpenIssuesCount. For backward compatibility OpenIssues is still populated.
55-
StargazersCount *int `json:"stargazers_count,omitempty"`
56-
SubscribersCount *int `json:"subscribers_count,omitempty"`
57-
WatchersCount *int `json:"watchers_count,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility WatchersCount is still populated.
58-
Watchers *int `json:"watchers,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility Watchers is still populated.
59-
Size *int `json:"size,omitempty"`
60-
AutoInit *bool `json:"auto_init,omitempty"`
61-
Parent *Repository `json:"parent,omitempty"`
62-
Source *Repository `json:"source,omitempty"`
63-
TemplateRepository *Repository `json:"template_repository,omitempty"`
64-
Organization *Organization `json:"organization,omitempty"`
65-
Permissions map[string]bool `json:"permissions,omitempty"`
66-
AllowRebaseMerge *bool `json:"allow_rebase_merge,omitempty"`
67-
AllowUpdateBranch *bool `json:"allow_update_branch,omitempty"`
68-
AllowSquashMerge *bool `json:"allow_squash_merge,omitempty"`
69-
AllowMergeCommit *bool `json:"allow_merge_commit,omitempty"`
70-
AllowAutoMerge *bool `json:"allow_auto_merge,omitempty"`
71-
AllowForking *bool `json:"allow_forking,omitempty"`
72-
WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"`
73-
DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"`
74-
UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"`
75-
SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE"
76-
SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK"
77-
MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE"
78-
MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK"
79-
Topics []string `json:"topics,omitempty"`
80-
Archived *bool `json:"archived,omitempty"`
81-
Disabled *bool `json:"disabled,omitempty"`
30+
ID *int64 `json:"id,omitempty"`
31+
NodeID *string `json:"node_id,omitempty"`
32+
Owner *User `json:"owner,omitempty"`
33+
Name *string `json:"name,omitempty"`
34+
FullName *string `json:"full_name,omitempty"`
35+
Description *string `json:"description,omitempty"`
36+
Homepage *string `json:"homepage,omitempty"`
37+
CodeOfConduct *CodeOfConduct `json:"code_of_conduct,omitempty"`
38+
DefaultBranch *string `json:"default_branch,omitempty"`
39+
MasterBranch *string `json:"master_branch,omitempty"`
40+
CreatedAt *Timestamp `json:"created_at,omitempty"`
41+
PushedAt *Timestamp `json:"pushed_at,omitempty"`
42+
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
43+
HTMLURL *string `json:"html_url,omitempty"`
44+
CloneURL *string `json:"clone_url,omitempty"`
45+
GitURL *string `json:"git_url,omitempty"`
46+
MirrorURL *string `json:"mirror_url,omitempty"`
47+
SSHURL *string `json:"ssh_url,omitempty"`
48+
SVNURL *string `json:"svn_url,omitempty"`
49+
Language *string `json:"language,omitempty"`
50+
Fork *bool `json:"fork,omitempty"`
51+
ForksCount *int `json:"forks_count,omitempty"`
52+
NetworkCount *int `json:"network_count,omitempty"`
53+
OpenIssuesCount *int `json:"open_issues_count,omitempty"`
54+
OpenIssues *int `json:"open_issues,omitempty"` // Deprecated: Replaced by OpenIssuesCount. For backward compatibility OpenIssues is still populated.
55+
StargazersCount *int `json:"stargazers_count,omitempty"`
56+
SubscribersCount *int `json:"subscribers_count,omitempty"`
57+
WatchersCount *int `json:"watchers_count,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility WatchersCount is still populated.
58+
Watchers *int `json:"watchers,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility Watchers is still populated.
59+
Size *int `json:"size,omitempty"`
60+
AutoInit *bool `json:"auto_init,omitempty"`
61+
Parent *Repository `json:"parent,omitempty"`
62+
Source *Repository `json:"source,omitempty"`
63+
TemplateRepository *Repository `json:"template_repository,omitempty"`
64+
Organization *Organization `json:"organization,omitempty"`
65+
Permissions map[string]bool `json:"permissions,omitempty"`
66+
AllowRebaseMerge *bool `json:"allow_rebase_merge,omitempty"`
67+
AllowUpdateBranch *bool `json:"allow_update_branch,omitempty"`
68+
AllowSquashMerge *bool `json:"allow_squash_merge,omitempty"`
69+
AllowMergeCommit *bool `json:"allow_merge_commit,omitempty"`
70+
AllowAutoMerge *bool `json:"allow_auto_merge,omitempty"`
71+
AllowForking *bool `json:"allow_forking,omitempty"`
72+
WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"`
73+
DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"`
74+
UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"`
75+
SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE"
76+
SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK"
77+
MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE"
78+
MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK"
79+
Topics []string `json:"topics,omitempty"`
80+
CustomProperties map[string]string `json:"custom_properties,omitempty"`
81+
Archived *bool `json:"archived,omitempty"`
82+
Disabled *bool `json:"disabled,omitempty"`
8283

8384
// Only provided when using RepositoriesService.Get while in preview
8485
License *License `json:"license,omitempty"`

0 commit comments

Comments
 (0)