@@ -320,12 +320,22 @@ func main() {
320320 processImages (updatedTargets , cfg )
321321
322322 if ! cfg .DryRun {
323- commitMsg := fmt .Sprintf ("GitOps for release branch %s from %s commit %s\n " ,
324- cfg .ReleaseBranch , cfg .BranchName , cfg .GitCommit )
323+ slug := os .Getenv ("BUILDKITE_PIPELINE_SLUG" )
324+ url := os .Getenv ("BUILDKITE_BUILD_URL" )
325+ repo := os .Getenv ("BUILDKITE_REPO" )
326+ sha := os .Getenv ("BUILDKITE_COMMIT" )
327+ repo = strings .Replace (repo , ":" , "/" , 1 )
328+ repo = strings .Replace (repo , "git@" , "https://" , 1 )
329+ repo = strings .Replace (repo , ".git" , "" , 1 )
330+ commit := fmt .Sprintf ("%s/commit/%s" , repo , sha )
331+ shortSha := sha [:7 ]
332+
333+ prTitle := fmt .Sprintf ("Gitops Deploy: %s - %s" , slug , shortSha )
334+ prDescription := fmt .Sprintf ("Automated PR for [%s](%s) via [Buildkite Pipeline](%s)" , slug , commit , url )
325335
326336 switch cfg .GitHost {
327337 case "github_app" :
328- github_app .CreateCommit (cfg .PRTargetBranch , cfg .BranchName , gitopsDir , modifiedFiles , commitMsg )
338+ github_app .CreateCommit (cfg .PRTargetBranch , cfg .BranchName , gitopsDir , modifiedFiles , prTitle , prDescription )
329339 return
330340 default :
331341 workdir .Push (updatedBranches )
0 commit comments