func Update()

in internal/commands/update.go [14:55]


func Update(log logrus.FieldLogger, httpClientFn httpClientFn) *cli.Command {
	return &cli.Command{
		Name:  "update",
		Usage: "Update a release using GitLab's Releases API https://docs.gitlab.com/ee/api/releases/#update-a-release",
		Action: func(ctx *cli.Context) error {
			client, err := httpClientFn(ctx, log)
			if err != nil {
				return err
			}

			return updateRelease(ctx, log, client)
		},
		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.StringFlag{
				Name:     flags.Name,
				Usage:    "The release name",
				Required: false,
			},
			&cli.StringFlag{
				Name:     flags.Description,
				Usage:    "The description of the release; you can use Markdown. A file can be used to read the description contents, must exist inside the working directory; if it contains any whitespace, it will be treated as a string",
				Required: false,
			},
			&cli.StringSliceFlag{
				Name:     flags.Milestone,
				Usage:    `List of the titles of each milestone the release is associated with (e.g. --milestone "v1.0" --milestone "v1.0-rc)"; each milestone needs to exist. Pass an empty string to remove all milestones from the release.`,
				Required: false,
			},
			&cli.StringFlag{
				Name:     flags.ReleasedAt,
				Usage:    `The date when the release will be/was ready; defaults to the current time; expected in ISO 8601 format (2019-03-15T08:00:00Z)`,
				Required: false,
			},
		},
	}
}