config

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2020 License: MIT Imports: 2 Imported by: 5

README

dependabot-config-go

CI GoDev

Package to marshal and unmarshal dependabot.yml config files.

Install

go get -u github.com/paulvollmer/dependabot-config-go

License

MIT - See LICENSE file

Documentation

Index

Constants

View Source
const (
	PackageEcosystemBundler       = "bundler"
	PackageEcosystemCargo         = "cargo"
	PackageEcosystemComposer      = "composer"
	PackageEcosystemDocker        = "docker"
	PackageEcosystemElm           = "elm"
	PackageEcosystemGitsubmodule  = "gitsubmodule"
	PackageEcosystemGitHubActions = "github-actions"
	PackageEcosystemGomod         = "gomod"
	PackageEcosystemGradle        = "gradle"
	PackageEcosystemMaven         = "maven"
	PackageEcosystemMix           = "mix"
	PackageEcosystemNpm           = "npm"
	PackageEcosystemNuGet         = "nuget"
	PackageEcosystemPip           = "pip"
	PackageEcosystemTerraform     = "terraform"
)
View Source
const (
	ScheduleIntervalDaily   = "daily"
	ScheduleIntervalWeekly  = "weekly"
	ScheduleIntervalMonthly = "monthly"
)
View Source
const (
	ScheduleIntervalDayMonday    = "monday"
	ScheduleIntervalDayTuesday   = "tuesday"
	ScheduleIntervalDayWednesday = "wednesday"
	ScheduleIntervalDayThursday  = "thursday"
	ScheduleIntervalDayFriday    = "friday"
	ScheduleIntervalDaySaturday  = "saturday"
	ScheduleIntervalDaySunday    = "sunday"
)

Variables

This section is empty.

Functions

func IsValidPackageEcosystem

func IsValidPackageEcosystem(e string) bool

func IsValidScheduleInterval

func IsValidScheduleInterval(i string) bool

func IsValidScheduleIntervalDay

func IsValidScheduleIntervalDay(i string) bool

Types

type Allow

type Allow struct {
	DependencyName string `yaml:"dependency-name,omitempty"`
	DependencyType string `yaml:"dependency-type,omitempty"`
}

Allow docs: https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#allow

func NewAllow

func NewAllow(dependencyName, dependencyType string) *Allow

type CommitMessage

type CommitMessage struct {
	Prefix            string `yaml:"prefix,omitempty"`
	PrefixDevelopment string `yaml:"prefix-development,omitempty"`
	Include           string `yaml:"include,omitempty"`
}

CommitMessage docs: https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#commit-message

func NewCommitMessage

func NewCommitMessage(prefix, prefixDevelopment, include string) *CommitMessage

type Config

type Config struct {
	Version int      `yaml:"version"`
	Updates []Update `yaml:"updates"`
}

Config for dependabot

func New

func New() *Config

func (*Config) AddUpdate

func (c *Config) AddUpdate(item Update)

AddUpdate append an Update item to the Updates array

func (*Config) HasPackageEcosystem

func (c *Config) HasPackageEcosystem(e string) bool

HasPackageEcosystem return true if the given package-ecosystem string exist at the Updates array

func (*Config) Marshal

func (c *Config) Marshal() ([]byte, error)

func (*Config) Unmarshal

func (c *Config) Unmarshal(data []byte) error

type Ignore

type Ignore struct {
	DependencyName string   `yaml:"dependency-name,omitempty"`
	Versions       []string `yaml:"versions,omitempty"`
}

Ignore docs: https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#ignore

func NewIgnore

func NewIgnore(dependencyName string, versions []string) *Ignore

func (*Ignore) AddVersion

func (i *Ignore) AddVersion(version string)

type PullRequestBranchName

type PullRequestBranchName struct {
	Separator string `yaml:"separator"`
}

PullRequestBranchName docs: https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#pull-request-branch-nameseparator

func NewPullRequestBranchName

func NewPullRequestBranchName(separator string) *PullRequestBranchName

type Schedule

type Schedule struct {
	Interval string `yaml:"interval"`
	Day      string `yaml:"day,omitempty"`
	Time     string `yaml:"time,omitempty"`
	Timezone string `yaml:"timezone,omitempty"`
}

Schedule docs: https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#scheduleinterval

func NewSchedule

func NewSchedule(interval string) (Schedule, error)

type Update

type Update struct {
	PackageEcosystem      string                 `yaml:"package-ecosystem"`
	Directory             string                 `yaml:"directory"`
	Schedule              Schedule               `yaml:"schedule"`
	Allow                 []*Allow               `yaml:"allow,omitempty"`
	Assignees             []*string              `yaml:"assignees,omitempty"`
	CommitMessage         *CommitMessage         `yaml:"commit-message,omitempty"`
	Ignore                []*Ignore              `yaml:"ignore,omitempty"`
	Labels                []*string              `yaml:"labels,omitempty"`
	Milestone             *int                   `yaml:"milestone,omitempty"`
	OpenPullRequestsLimit *int                   `yaml:"open-pull-requests-limit,omitempty"`
	PullRequestBranchName *PullRequestBranchName `yaml:"pull-request-branch-name,omitempty"`
	RebaseStrategy        *string                `yaml:"rebase-strategy,omitempty"`
	Reviewers             []*string              `yaml:"reviewers,omitempty"`
	TargetBranch          *string                `yaml:"target-branch,omitempty"`
	VersioningStrategy    *string                `yaml:"versioning-strategy,omitempty"`
}

Update docs: https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates

func (*Update) AddAllow

func (u *Update) AddAllow(allow *Allow)

func (*Update) AddAssignee

func (u *Update) AddAssignee(assignee string)

func (*Update) AddIgnore

func (u *Update) AddIgnore(ignore *Ignore)

func (*Update) AddLabel

func (u *Update) AddLabel(label string)

func (*Update) AddReviewer

func (u *Update) AddReviewer(reviewer string)

Jump to

Keyboard shortcuts

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