Add option to pass a version message

This commit is contained in:
Stephen Paulger
2024-04-10 10:45:16 +01:00
committed by Manuel Rüger
parent b7cb1824ae
commit 9b91ee3344
2 changed files with 9 additions and 2 deletions

View File

@@ -84,6 +84,12 @@ var flags = []cli.Flag{
Usage: "don't send notifications while updating Confluence page.",
EnvVars: []string{"MARK_MINOR_EDIT"},
}),
altsrc.NewStringFlag(&cli.StringFlag{
Name: "version-message",
Value: "",
Usage: "add a message to the page version, to explain the edit (default: \"\")",
EnvVars: []string{"MARK_VERSION_MESSAGE"},
}),
altsrc.NewStringFlag(&cli.StringFlag{
Name: "color",
Value: "auto",
@@ -511,7 +517,7 @@ func processFile(
html = buffer.String()
}
err = api.UpdatePage(target, html, cCtx.Bool("minor-edit"), meta.Labels, meta.ContentAppearance)
err = api.UpdatePage(target, html, cCtx.Bool("minor-edit"), cCtx.String("version-message"), meta.Labels, meta.ContentAppearance)
if err != nil {
log.Fatal(err)
}