Skip to content

Commit

Permalink
fix(gitlab): correct the value of SHATitle in Merge event
Browse files Browse the repository at this point in the history
In this context, the SHATitle should be the title of the last commit,
while the PullRequestTitle is the title of the PR.
  • Loading branch information
l-qing committed Feb 1, 2025
1 parent d146051 commit 21da37a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/provider/gitlab/parse_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (v *Provider) ParsePayload(_ context.Context, _ *params.Run, request *http.
processedEvent.URL = gitEvent.Project.WebURL
processedEvent.SHA = gitEvent.ObjectAttributes.LastCommit.ID
processedEvent.SHAURL = gitEvent.ObjectAttributes.LastCommit.URL
processedEvent.SHATitle = gitEvent.ObjectAttributes.Title
processedEvent.SHATitle = gitEvent.ObjectAttributes.LastCommit.Title
processedEvent.HeadBranch = gitEvent.ObjectAttributes.SourceBranch
processedEvent.BaseBranch = gitEvent.ObjectAttributes.TargetBranch
processedEvent.HeadURL = gitEvent.ObjectAttributes.Source.WebURL
Expand Down
1 change: 1 addition & 0 deletions pkg/provider/gitlab/parse_payload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func TestParsePayload(t *testing.T) {
TriggerTarget: "pull_request",
Organization: "hello/this/is/me/ze",
Repository: "project",
SHATitle: "commit it",
},
},
{
Expand Down

0 comments on commit 21da37a

Please sign in to comment.