mirror of https://github.com/harness/drone.git
parent
516fd5c1ca
commit
0952d00a31
|
@ -95,6 +95,7 @@ func activityPayload(out *label.AssignToPullReqOut) *types.PullRequestActivityLa
|
|||
return &types.PullRequestActivityLabel{
|
||||
Label: out.Label.Key,
|
||||
LabelColor: out.Label.Color,
|
||||
LabelScope: out.Label.Scope,
|
||||
Value: value,
|
||||
ValueColor: valueColor,
|
||||
OldValue: oldValue,
|
||||
|
|
|
@ -68,6 +68,7 @@ func (c *Controller) UnassignLabel(
|
|||
payload := &types.PullRequestActivityLabel{
|
||||
Label: label.Key,
|
||||
LabelColor: label.Color,
|
||||
LabelScope: label.Scope,
|
||||
Value: value,
|
||||
ValueColor: color,
|
||||
Type: enum.LabelActivityUnassign,
|
||||
|
|
|
@ -148,6 +148,9 @@ func (s *Service) Save(
|
|||
for i, value := range valuesToCreate {
|
||||
valuesToReturn[i] = newLabelValue(principalID, label.ID, &value.DefineValueInput)
|
||||
if err = s.labelValueStore.Define(ctx, valuesToReturn[i]); err != nil {
|
||||
if errors.Is(err, store.ErrDuplicate) {
|
||||
return errors.Conflict("value %s already exists", valuesToReturn[i].Value)
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,6 +160,7 @@ func (a *PullRequestActivityPayloadBranchDelete) ActivityType() enum.PullReqActi
|
|||
type PullRequestActivityLabel struct {
|
||||
Label string `json:"label"`
|
||||
LabelColor enum.LabelColor `json:"label_color"`
|
||||
LabelScope int64 `json:"label_scope"`
|
||||
Value *string `json:"value,omitempty"`
|
||||
ValueColor *enum.LabelColor `json:"value_color,omitempty"`
|
||||
OldValue *string `json:"old_value,omitempty"`
|
||||
|
|
Loading…
Reference in New Issue