Skip to content

Commit

Permalink
Add a flag to annotate to allow removal of existing annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
ticky committed Jan 22, 2021
1 parent ce3d6ed commit 50c41a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type Annotation struct {
Context string `json:"context,omitempty"`
Style string `json:"style,omitempty"`
Append bool `json:"append,omitempty"`
Remove bool `json:"remove,omitempty"`
}

// Annotate a build in the Buildkite UI
Expand Down
7 changes: 7 additions & 0 deletions clicommand/annotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type AnnotateConfig struct {
Style string `cli:"style"`
Context string `cli:"context"`
Append bool `cli:"append"`
Remove bool `cli:"remove"`
Job string `cli:"job" validate:"required"`

// Global flags
Expand Down Expand Up @@ -87,6 +88,11 @@ var AnnotateCommand = cli.Command{
Usage: "Append to the body of an existing annotation",
EnvVar: "BUILDKITE_ANNOTATION_APPEND",
},
cli.BoolFlag{
Name: "remove",
Usage: "Remove an existing annotation",
EnvVar: "BUILDKITE_ANNOTATION_REMOVE",
},
cli.StringFlag{
Name: "job",
Value: "",
Expand Down Expand Up @@ -147,6 +153,7 @@ var AnnotateCommand = cli.Command{
Style: cfg.Style,
Context: cfg.Context,
Append: cfg.Append,
Remove: cfg.Remove,
}

// Retry the annotation a few times before giving up
Expand Down

0 comments on commit 50c41a3

Please sign in to comment.