generate

package
v0.0.0-...-3a64406 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cli.Command{
	Name:  "generate",
	Usage: "Builds a changelog.yaml file from multiple sources",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    markdownPathFlag,
			EnvVars: common.EnvFor(markdownPathFlag),
			Usage:   "Gather changelog entries from the specified file",
			Value:   "CHANGELOG.md",
		},
		&cli.BoolFlag{
			Name:    renovateFlag,
			EnvVars: common.EnvFor(renovateFlag),
			Usage:   "Gather changelog entries from renovate commits since last tag",
			Value:   true,
		},
		&cli.StringSliceFlag{
			Name:    includedDirsFlag,
			EnvVars: common.EnvFor(includedDirsFlag),
			Usage: `Only scan commits scoping at least one file in any of the following comma-separated directories, relative to repository root (--dir) ` +
				`(Paths may not start with "/" or contain ".." or "." tokens)`,
		},
		&cli.StringSliceFlag{
			Name:    excludedDirsFlag,
			EnvVars: common.EnvFor(includedDirsFlag),
			Usage: `Exclude commits whose changes only impact files in specified dirs relative to repository root (--dir) (separated by comma) ` +
				`(Paths may not start with "/" or contain ".." or "." tokens)`,
		},
		&cli.BoolFlag{
			Name:    dependabotFlag,
			EnvVars: common.EnvFor(dependabotFlag),
			Usage:   "Gather changelog entries from dependabot commits since last tag",
			Value:   true,
		},

		&cli.StringFlag{
			Name:    tagPrefixFlag,
			EnvVars: common.EnvFor(tagPrefixFlag),
			Usage:   "Find commits since latest tag matching this prefix.",
			Value:   "",
		},
		&cli.StringFlag{
			Name:    gitRootFlag,
			EnvVars: common.EnvFor(gitRootFlag),
			Usage:   "Path to the git repo to get commits and tags for.",
			Value:   "./",
		},
		&cli.IntFlag{
			Name:    exitCodeFlag,
			EnvVars: common.EnvFor(exitCodeFlag),
			Usage:   "Exit code if generated changelog is empty",
			Value:   1,
		},
	},
	Action: Generate,
}

Cmd is the cli.Command object for the generate command.

View Source
var ErrNoSources = errors.New("cannot generate changelog without at least one source enabled")

ErrNoSources is returned if Generate is invoked without any source enabled.

Functions

func Generate

func Generate(cCtx *cli.Context) error

Generate is a command that creates a changelog.yaml file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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