Skip to content

Commit

Permalink
Update plugin.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Ompragash authored Aug 27, 2024
1 parent 6aee062 commit ad054e1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ func Exec(ctx context.Context, args Args) error {
return errors.New("failed to extract issue number")
}

commitMessage := args.Commit.Message
if len(commitMessage) > 255 {
logger.Warnln("Commit message exceeds 255 characters; truncating to fit.")
commitMessage = commitMessage[:252] + "..."
}

logger = logger.WithField("issue", issue)
logger.Debugln("successfully extraced issue number")

Expand All @@ -110,7 +116,7 @@ func Exec(ctx context.Context, args Args) error {
},
Displayname: strconv.Itoa(args.Build.Number),
URL: deeplink,
Description: args.Commit.Message,
Description: commitMessage,
Lastupdated: time.Now(),
State: state,
Pipeline: JiraPipeline{
Expand All @@ -130,7 +136,7 @@ func Exec(ctx context.Context, args Args) error {
Builds: []*Build{
{
BuildNumber: args.Build.Number,
Description: args.Commit.Message,
Description: commitMessage,
DisplayName: args.Name,
URL: deeplink,
LastUpdated: time.Now(),
Expand Down

0 comments on commit ad054e1

Please sign in to comment.