Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for adding apps to branch protection #1337

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions github/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type App struct {
HTMLURL *string `json:"html_url,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
Slug *string `json:"slug,omitempty"`
}

// InstallationToken represents an installation token.
Expand Down
4 changes: 4 additions & 0 deletions github/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,8 @@ type BranchRestrictions struct {
Users []*User `json:"users"`
// The list of team slugs with push access.
Teams []*Team `json:"teams"`
// The list of app slugs with push access.
Apps []*App `json:"apps"`
}

// BranchRestrictionsRequest represents the request to create/edit the
Expand All @@ -802,6 +804,8 @@ type BranchRestrictionsRequest struct {
Users []string `json:"users"`
// The list of team slugs with push access. (Required; use []string{} instead of nil for empty list.)
Teams []string `json:"teams"`
// The list of app slugs with push access. (Required; use []string{} instead of nil for empty list.)
Apps []string `json:"apps"`
}

// DismissalRestrictions specifies which users and teams can dismiss pull request reviews.
Expand Down