github

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2025 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch

type Branch struct {
	Name       string            `yaml:"name"`
	Protection *BranchProtection `yaml:"protection,omitempty"`
}

Branch represents branch protection settings

type BranchProtection

type BranchProtection struct {
	RequiredPullRequestReviews *RequiredPullRequestReviews `yaml:"required_pull_request_reviews"`
	RequiredStatusChecks       *RequiredStatusChecks       `yaml:"required_status_checks"`
	EnforceAdmins              bool                        `yaml:"enforce_admins"`
	AllowForcePush             bool                        `yaml:"allow_force_pushes"`
	AllowDeletions             bool                        `yaml:"allow_deletions"`
	RequiredLinearHistory      bool                        `yaml:"required_linear_history,omitempty"`
	Restrictions               *Restrictions               `yaml:"restrictions"`
}

BranchProtection contains branch protection rules

type Collaborator

type Collaborator struct {
	Username   string `yaml:"username"`
	Permission string `yaml:"permission"`
}

Collaborator represents a repository collaborator

type DismissalRestrictions

type DismissalRestrictions struct {
	Users []string `yaml:"users,omitempty"`
	Teams []string `yaml:"teams,omitempty"`
}

DismissalRestrictions specifies who can dismiss reviews

type Label

type Label struct {
	Name        string `yaml:"name"`
	Color       string `yaml:"color"`
	Description string `yaml:"description,omitempty"`
	NewName     string `yaml:"new_name,omitempty"`
}

Label represents a GitHub label configuration

type Milestone

type Milestone struct {
	Title       string `yaml:"title"`
	Description string `yaml:"description,omitempty"`
	State       string `yaml:"state"`
}

Milestone represents a GitHub milestone configuration

type RepoSettings

type RepoSettings struct {
	Repository    Repository     `yaml:"repository"`
	Labels        []Label        `yaml:"labels,omitempty"`
	Milestones    []Milestone    `yaml:"milestones,omitempty"`
	Collaborators []Collaborator `yaml:"collaborators,omitempty"`
	Teams         []Team         `yaml:"teams,omitempty"`
	Branches      []Branch       `yaml:"branches,omitempty"`
}

RepoSettings represents the root configuration structure for GitHub repository settings.

See: https://github.com/apps/settings And: https://github.com/repository-settings/app/blob/master/docs/configuration.md

TODO: Potential to use this? https://github.com/google/go-github

type Repository

type Repository struct {
	Name                         string `yaml:"name,omitempty"`
	Description                  string `yaml:"description,omitempty"`
	Homepage                     string `yaml:"homepage,omitempty"`
	Topics                       string `yaml:"topics,omitempty"`
	Private                      bool   `yaml:"private,omitempty"`
	HasIssues                    bool   `yaml:"has_issues,omitempty"`
	HasProjects                  bool   `yaml:"has_projects,omitempty"`
	HasWiki                      bool   `yaml:"has_wiki,omitempty"`
	HasDownloads                 bool   `yaml:"has_downloads,omitempty"`
	DefaultBranch                string `yaml:"default_branch,omitempty"`
	AllowSquashMerge             bool   `yaml:"allow_squash_merge,omitempty"`
	AllowMergeCommit             bool   `yaml:"allow_merge_commit"`
	AllowRebaseMerge             bool   `yaml:"allow_rebase_merge,omitempty"`
	DeleteBranchOnMerge          bool   `yaml:"delete_branch_on_merge,omitempty"`
	EnableAutomatedSecurityFixes bool   `yaml:"enable_automated_security_fixes,omitempty"`
	EnableVulnerabilityAlerts    bool   `yaml:"enable_vulnerability_alerts,omitempty"`
}

Repository contains all repository-level settings

type RequiredPullRequestReviews

type RequiredPullRequestReviews struct {
	RequiredApprovingReviewCount int                    `yaml:"required_approving_review_count"`
	DismissStaleReviews          bool                   `yaml:"dismiss_stale_reviews,omitempty"`
	RequireCodeOwnerReviews      bool                   `yaml:"require_code_owner_reviews,omitempty"`
	DismissalRestrictions        *DismissalRestrictions `yaml:"dismissal_restrictions,omitempty"`
}

RequiredPullRequestReviews contains PR review requirements

type RequiredStatusChecks

type RequiredStatusChecks struct {
	Strict   bool     `yaml:"strict"`
	Contexts []string `yaml:"contexts,omitempty"`
}

RequiredStatusChecks contains status check requirements

type Restrictions

type Restrictions struct {
	Apps  []string `yaml:"apps"`
	Users []string `yaml:"users"`
	Teams []string `yaml:"teams"`
}

Restrictions contains push restrictions

type Team

type Team struct {
	Name       string `yaml:"name"`
	Permission string `yaml:"permission"`
}

Team represents a team with repository access

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL