mirror of
https://github.com/harness/drone.git
synced 2025-05-31 11:43:15 +00:00
feat: [PIPE-23720]: add author details to the commits API (#3095)
* addressed review comment * feat: [PIPE-23720]: add author details to the commits API
This commit is contained in:
parent
18da27f968
commit
423702f0c0
@ -15,6 +15,7 @@
|
|||||||
package repo
|
package repo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"cmp"
|
||||||
"context"
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -57,6 +58,7 @@ type CommitFilesOptions struct {
|
|||||||
Branch string `json:"branch"`
|
Branch string `json:"branch"`
|
||||||
NewBranch string `json:"new_branch"`
|
NewBranch string `json:"new_branch"`
|
||||||
Actions []CommitFileAction `json:"actions"`
|
Actions []CommitFileAction `json:"actions"`
|
||||||
|
Author *git.Identity `json:"author"`
|
||||||
|
|
||||||
DryRunRules bool `json:"dry_run_rules"`
|
DryRunRules bool `json:"dry_run_rules"`
|
||||||
BypassRules bool `json:"bypass_rules"`
|
BypassRules bool `json:"bypass_rules"`
|
||||||
@ -166,7 +168,7 @@ func (c *Controller) CommitFiles(ctx context.Context,
|
|||||||
Actions: actions,
|
Actions: actions,
|
||||||
Committer: identityFromPrincipal(bootstrap.NewSystemServiceSession().Principal),
|
Committer: identityFromPrincipal(bootstrap.NewSystemServiceSession().Principal),
|
||||||
CommitterDate: &now,
|
CommitterDate: &now,
|
||||||
Author: identityFromPrincipal(session.Principal),
|
Author: cmp.Or(in.Author, identityFromPrincipal(session.Principal)),
|
||||||
AuthorDate: &now,
|
AuthorDate: &now,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user