@@ -341,21 +341,45 @@ func (client *GitHubClient) GetPullRequestDetailsSizeLimit() int {
341341// CreatePullRequest on GitHub
342342func (client * GitHubClient )CreatePullRequest (ctx context.Context ,owner ,repository ,sourceBranch ,targetBranch ,title ,description string )error {
343343return client .runWithRateLimitRetries (func () (* github.Response ,error ) {
344- return client .executeCreatePullRequest (ctx ,owner ,repository ,sourceBranch ,targetBranch ,title ,description )
344+ _ ,githubResponse ,err := client .executeCreatePullRequest (ctx ,owner ,repository ,sourceBranch ,targetBranch ,title ,description )
345+ return githubResponse ,err
345346})
346347}
347348
348- func (client * GitHubClient )executeCreatePullRequest (ctx context.Context ,owner ,repository ,sourceBranch ,targetBranch ,title ,description string ) (* github.Response ,error ) {
349+ func (client * GitHubClient )CreatePullRequestDetailed (ctx context.Context ,owner ,repository ,sourceBranch ,targetBranch ,title ,description string ) (CreatedPullRequestInfo ,error ) {
350+ var prInfo CreatedPullRequestInfo
351+
352+ err := client .runWithRateLimitRetries (func () (* github.Response ,error ) {
353+ pr ,ghResponse ,err := client .executeCreatePullRequest (ctx ,owner ,repository ,sourceBranch ,targetBranch ,title ,description )
354+ if err != nil {
355+ return ghResponse ,err
356+ }
357+ prInfo = mapToPullRequestInfo (pr )
358+ return ghResponse ,nil
359+ })
360+
361+ return prInfo ,err
362+ }
363+
364+ func (client * GitHubClient )executeCreatePullRequest (ctx context.Context ,owner ,repository ,sourceBranch ,targetBranch ,title ,description string ) (* github.PullRequest ,* github.Response ,error ) {
349365head := owner + ":" + sourceBranch
350366client .logger .Debug (vcsutils .CreatingPullRequest ,title )
351367
352- _ ,ghResponse ,err := client .ghClient .PullRequests .Create (ctx ,owner ,repository ,& github.NewPullRequest {
368+ pr ,ghResponse ,err := client .ghClient .PullRequests .Create (ctx ,owner ,repository ,& github.NewPullRequest {
353369Title :& title ,
354370Body :& description ,
355371Head :& head ,
356372Base :& targetBranch ,
357373})
358- return ghResponse ,err
374+ return pr ,ghResponse ,err
375+ }
376+
377+ func mapToPullRequestInfo (pr * github.PullRequest )CreatedPullRequestInfo {
378+ return CreatedPullRequestInfo {
379+ Number :pr .GetNumber (),
380+ URL :pr .GetHTMLURL (),
381+ StatusesUrl :pr .GetStatusesURL (),
382+ }
359383}
360384
361385// UpdatePullRequest on GitHub
@@ -1003,6 +1027,7 @@ func (client *GitHubClient) DownloadFileFromRepo(ctx context.Context, owner, rep
10031027content ,statusCode ,ghResponse ,err = client .executeDownloadFileFromRepo (ctx ,owner ,repository ,branch ,path )
10041028return ghResponse ,err
10051029})
1030+
10061031return
10071032}
10081033