Add --minor-edit command-line flag

This commit is contained in:
Rolf Ahrenberg 2021-01-04 15:42:34 +02:00
parent f86dd2723a
commit 1d8e43add2
3 changed files with 8 additions and 3 deletions

View File

@ -270,6 +270,7 @@ mark -h | --help
manual edits over Confluence Web UI.
- `--drop-h1` Don't include H1 headings in Confluence output.
- `--dry-run` — Show resulting HTML and don't update Confluence page content.
- `--minor-edit` — Don't send notifications while updating Confluence page.
- `--trace` — Enable trace logs.
- `-v | --version` — Show version.
- `-h | --help` — Show help screen and call 911.
@ -284,6 +285,8 @@ password = "matrixishere"
base_url = "http://confluence.local"
```
**NOTE**: Labels aren't supported when using `minor-edit`!
# Tricks
## Continuous Integration

View File

@ -43,6 +43,7 @@ Options:
--drop-h1 Don't include H1 headings in Confluence output.
--dry-run Resolve page and ancestry, show resulting HTML and exit.
--compile-only Show resulting HTML and don't update Confluence page content.
--minor-edit Don't send notifications while updating Confluence page.
--debug Enable debug logs.
--trace Enable trace logs.
-h --help Show this screen and call 911.
@ -62,6 +63,7 @@ func main() {
dryRun = args["--dry-run"].(bool)
editLock = args["-k"].(bool)
dropH1 = args["--drop-h1"].(bool)
minorEdit = args["--minor-edit"].(bool)
)
if args["--debug"].(bool) {
@ -240,7 +242,7 @@ func main() {
html = buffer.String()
}
err = api.UpdatePage(target, html, meta.Labels)
err = api.UpdatePage(target, html, minorEdit, meta.Labels)
if err != nil {
log.Fatal(err)
}

View File

@ -434,7 +434,7 @@ func (api *API) CreatePage(
}
func (api *API) UpdatePage(
page *PageInfo, newContent string, newLabels []string,
page *PageInfo, newContent string, minorEdit bool, newLabels []string,
) error {
nextPageVersion := page.Version.Number + 1
@ -467,7 +467,7 @@ func (api *API) UpdatePage(
"title": page.Title,
"version": map[string]interface{}{
"number": nextPageVersion,
"minorEdit": false,
"minorEdit": minorEdit,
},
"ancestors": oldAncestors,
"body": map[string]interface{}{