src

package
v0.0.0-...-74ea383 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDraftRelease

func CreateDraftRelease(c *gitea.Client, owner string, repo string, targetBranch string, title string, tag string, body string) (*gitea.Release, error)

func FillVariables

func FillVariables(str string, vars TemplateVariables) string

func FindReleases

func FindReleases(c *gitea.Client, owner string, repo string) (*gitea.Release, *gitea.Release, error)

func GetRepo

func GetRepo(c *gitea.Client, owner string, repoName string) (*gitea.Repository, error)

func ResolveVersion

func ResolveVersion(cfg *config.RepoConfig, last *gitea.Release, changelog *Changelog) (*semver.Version, error)

ResolveVersion determines the next version to be used for a release depending on the labels used in the pull requests merged after the last release.

func UpdateExistingDraft

func UpdateExistingDraft(c *gitea.Client, owner string, repo string, draft *gitea.Release, title string, tag string, body string) (*gitea.Release, error)

Types

type Action

type Action struct {
	// contains filtered or unexported fields
}

func NewAction

func NewAction(ctx *context.Context, cfg *config.DrafterConfig) (*Action, error)

NewAction factory for a new action

func (*Action) GetConfigFile

func (a *Action) GetConfigFile(ref string) (*bytes.Reader, error)

GetConfigFile reads the local configuration file in `.gitea/` in the ref branch (probably main/master)

func (*Action) Run

func (a *Action) Run() error

Run builds the configuration and executes the action logic

type Changelog

type Changelog map[string][]*gitea.PullRequest

func GenerateChangelog

func GenerateChangelog(c *gitea.Client, owner string, repo string, lastRelease *gitea.Release, categories []config.Category) (*Changelog, error)

GenerateChangelog fetches all the pull requests merged into the default branch since the last release and groups them by label.

type TemplateVariables

type TemplateVariables struct {
	ReleaseVersion string `var:"$RESOLVED_VERSION"`
}

Directories

Path Synopsis
this file implements configurations for repositories
this file implements configurations for repositories

Jump to

Keyboard shortcuts

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