Skip to content

Commit

Permalink
fixes #447 : fix if project robot
Browse files Browse the repository at this point in the history
Signed-off-by: flbla <[email protected]>
  • Loading branch information
flbla committed Jun 21, 2024
1 parent dd17e44 commit 9d93a41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions provider/resource_robot_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ func resourceRobotAccountRead(d *schema.ResourceData, m interface{}) error {
if err != nil {
return fmt.Errorf("error getting system configuration %s", err)
}

shortName := strings.TrimPrefix(robot.Name, systemConfig.RobotNamePrefix.Value)
if robot.Level == "project" {
shortName = strings.Split(shortName, "+")[1]
}

d.Set("name", shortName)
d.Set("robot_id", strconv.Itoa(robot.ID))
Expand Down

0 comments on commit 9d93a41

Please sign in to comment.