releaseupdater

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "1.6.1"

Functions

func ProcessNewRelease

func ProcessNewRelease(ctx Context, release *github.ReleaseEvent)

func ReplaceVersion

func ReplaceVersion(content []byte, regex, newVersion string) []byte

returns a copy of content where versions according to the regex are replaced.

Example:

(?P<key>\s*version:\s*)(?P<value>v.*?)(?P<other>$|\s+\.*)

Important: the regex MUST define the following groups keys and other in order to work. Otherwise the version is not replaced.

key defines the key including the preceding characters. This may be needed for formats like YAML.

other contains everything you want to keep in that line behind the version value to replace.

func ReplaceVersionString

func ReplaceVersionString(content, regex, newVersion string) string

convenience method for ReplaceVersion to ease testing

Types

type Action

type Action struct {
	From      string
	Component string
	Update    []Update
}

type Config

type Config struct {
	Actions []Action
}

func GetConfig

func GetConfig(configFilename string) (*Config, error)

type Context added in v1.0.0

type Context struct {
	Config          *Config
	ProbotCtx       *probot.Context
	BitbucketClient *bitbucket.Client
}

type Update

type Update struct {
	RepoType string   `yaml:"repoType"`
	Repo     string   // name of the repo
	Files    []string // reference to files in repo
	Regex    string   // regex for searching the to-be-replaced item
	Branch   string   `yaml:"branch"` // target branch for update
}

Jump to

Keyboard shortcuts

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