Skip to content

Commit aea2735

Browse files
authored
Merge pull request #108 from section/add-git-author
add author to git commit
2 parents 7f219d0 + 53761ed commit aea2735

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

commands/gitService.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import (
77
"log"
88
"os"
99
"path/filepath"
10-
10+
"time"
1111
"github.com/go-git/go-git/v5"
1212
gitHTTP "github.com/go-git/go-git/v5/plumbing/transport/http"
1313
"github.com/section/sectionctl/api"
14+
"github.com/go-git/go-git/v5/plumbing/object"
1415
)
1516

1617
// GitService interface provides a way to interact with Git
@@ -112,7 +113,11 @@ func (g *GS) UpdateGitViaGit(c *DeployCmd, response UploadResponse) error {
112113
if err != nil {
113114
return err
114115
}
115-
commitHash, err := w.Commit("[sectionctl] updated nodejs/.section-external-source.json with new deployment.", &git.CommitOptions{})
116+
commitHash, err := w.Commit("[sectionctl] updated nodejs/.section-external-source.json with new deployment.", &git.CommitOptions{Author: &object.Signature{
117+
Name: "sectionctl",
118+
Email: "noreply@section.io",
119+
When: time.Now(),
120+
}})
116121
if err != nil {
117122
return fmt.Errorf("failed to make a commit on the temporary repository: %w", err)
118123
}

0 commit comments

Comments
 (0)