link

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cli.Command{
	Name:      "link-dependencies",
	Usage:     "Attempts to add links to the original changelogs for dependency bumps in changelog.yaml. The link is computed automatically when the dependency name is a full route or it's got from a dictionary file when present.",
	UsageText: `Link dependencies retrieves the links for each dependency detecting the link if the name is a full route or matching an entry in the dictionary file.`,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    dictionaryPathFlag,
			EnvVars: common.EnvFor(dictionaryPathFlag),
			Usage: "Path to a dictionary file mapping dependencies to their changelogs. " +
				"A dictionary is a YAML file with a root dictionary object, which contains a map from " +
				"dependency names to a template that will be rendered into a URL pointing to its changelog. " +
				"The template link must be in Go tpl format and typically will include the {{.To.Original}} variable " +
				"that will be replaced by the last bumped version (execute link-dependencies with --sample flag to see a dictionary.yml sample)",
			Value: "",
		},
		&cli.BoolFlag{
			Name:    sampleFlag,
			EnvVars: common.EnvFor(sampleFlag),
			Usage:   "Prints a sample dictionary to stdout.",
		},
		&cli.BoolFlag{
			Name:    disableGithubValidationFlag,
			EnvVars: common.EnvFor(disableGithubValidationFlag),
			Usage: "Disables changelog links validation for automatically detected Github repositories. " +
				"Github links validation performs a request to the rendered link in order to check if it actually exits. It the validation " +
				"fails, it will try a new link with/without the version's leading 'v' (which is a common issue when rendering Github links). " +
				"If generating a valid link is not possible, no link will be obtained for that particular dependency. " +
				"When disabled, changelog links for Github repositories are directly rendered using " +
				"https://github.com/<org>/<repo>/releases/tag/<new-version> with no validation, so no external request are performed.",
			Value: false,
		},
	},
	Action: Link,
}

Cmd is the cli.Command object for the link-dependencies command.

Functions

func Link(cCtx *cli.Context) error

Link is a command function which tries to add a link to the changelog of each dependency in a changelog computing them from each of the defined mappers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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