common

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: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// YAMLFlag is the command line flag to specify the path to a changelog.yaml file.
	// This flag is common and used by most commands.
	YAMLFlag = "yaml"

	// GHAFlag is the flag used by commands to identify if they should output GHA-syntax to stdout.
	GHAFlag = "gha"
	// GHAEnv is the env var equivalent for GHAFlag
	// GITHUB_ACTIONS: Always set to true when GitHub Actions is running the workflow. You can use this
	// variable to differentiate when tests are being run locally or by GitHub Actions.
	// https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
	GHAEnv = "GITHUB_ACTIONS"
)

Variables

This section is empty.

Functions

func EnvFor

func EnvFor(flag string, prefixes ...string) []string

EnvFor automatically calculates the environment var equivalent of a command line flag. It does so by uppercasing and replacing dashes `-` with underscores `_`. An optional list of prefixes without separator might be supplied, in which case they are prepended to the resulting env var in order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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