@@ -19,8 +19,6 @@ var gitUserEmail = flag.String("git.user.email", "", "git user email")
1919
2020const goRepoURL = "https://github.com/golang/go.git"
2121
22- const myRemote = "origin"
23-
2422const mprof = "src/runtime/mprof.go"
2523const pprof = "src/runtime/pprof"
2624const repoDir = "go_repo"
@@ -120,7 +118,7 @@ func updatePR(prBodyFile string, request PullRequest) {
120118 shMy .sh (fmt .Sprintf ("git config user.email '%s'" , * gitUserEmail ))
121119 }
122120 shMy .sh (fmt .Sprintf ("git commit -am '%s'" , commitMessage ))
123- shMy .sh (fmt .Sprintf ("git push -f %s %s:%s" , myRemote , branchName , request .HeadRefName ))
121+ shMy .sh (fmt .Sprintf ("git push -f %s %s:%s" , remote () , branchName , request .HeadRefName ))
124122
125123 shMy .sh (fmt .Sprintf ("gh pr edit %d --body-file '%s'" , request .Number , prBodyFile ))
126124
@@ -136,12 +134,17 @@ func createPR(prBodyFile string) {
136134 shMy .sh (fmt .Sprintf ("git config user.email '%s'" , * gitUserEmail ))
137135 }
138136 shMy .sh (fmt .Sprintf ("git commit -am '%s'" , commitMessage ))
139- shMy .sh (fmt .Sprintf ("git push %s %s" , myRemote , branchName ))
137+ shMy .sh (fmt .Sprintf ("git push %s %s" , remote () , branchName ))
140138
141139 shMy .sh (fmt .Sprintf ("gh pr create --title '%s' --body-file '%s' --label '%s' " , commitMessage , prBodyFile , label ))
142140
143141}
144142
143+ func remote () string {
144+ token := strings .TrimSpace (os .Getenv ("GITHUB_TOKEN" ))
145+ return fmt .
Sprintf (
"https://x-access-token:%[email protected] /grafana/pyroscope-go.git" ,
token )
146+ }
147+
145148func createCommitMessage () string {
146149 return fmt .Sprintf ("chore(check_golang_profiler_changes): acknowledge new golang profiler changes" )
147150}
0 commit comments