func Get()

in internal/commands/get.go [15:43]


func Get(log logrus.FieldLogger, httpClientFn httpClientFn) *cli.Command {
	return &cli.Command{
		Name:  "get",
		Usage: "Get a Release by tag name using GitLab's Releases API https://docs.gitlab.com/ee/api/releases/index.html#get-a-release-by-a-tag-name",
		Action: func(ctx *cli.Context) error {
			client, err := httpClientFn(ctx, log)
			if err != nil {
				return fmt.Errorf("http client: %w", err)
			}

			return getRelease(ctx, log, client)
		},
		Subcommands: nil,
		Flags: []cli.Flag{
			&cli.StringFlag{
				Name:     flags.TagName,
				Usage:    "The Git tag the release is associated with",
				Required: true,
				EnvVars:  []string{"CI_COMMIT_TAG"},
			},
			&cli.BoolFlag{
				Name:     flags.IncludeHTMLDescription,
				Usage:    "If true, a response includes HTML rendered Markdown of the release description",
				Required: false,
				EnvVars:  []string{"INCLUDE_HTML_DESCRIPTION"},
			},
		},
	}
}