Skip to content

Commit

Permalink
Add tag message.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Feb 27, 2024
1 parent 3de233e commit 1828228
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func DeleteBranch(repoURL, branch string) error {
return nil
}

func CreateTag(repoURL, branch, tag string) error {
func CreateTag(repoURL, branch, tag, user string) error {
r, err := git.Clone(memory.NewStorage(), memfs.New(), &git.CloneOptions{
URL: repoURL,
Depth: 1,
Expand Down Expand Up @@ -155,6 +155,7 @@ func CreateTag(repoURL, branch, tag string) error {
Name: defaultAuthor,
Email: defaultAuthorMail,
},
Message: "Bumped through metal-robot by " + user,
})
if err != nil {
return fmt.Errorf("error creating tag: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/webhooks/github/actions/issues_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (r *IssuesAction) tag(ctx context.Context, p *IssuesActionParams, args []st
targetRepoURL.User = url.UserPassword("x-access-token", token)

headRef := *pullRequest.Head.Ref
err = git.CreateTag(p.RepositoryURL, headRef, tag)
err = git.CreateTag(p.RepositoryURL, headRef, tag, p.User)
if err != nil {
return err
}
Expand Down

0 comments on commit 1828228

Please sign in to comment.