Skip to content

Commit

Permalink
convert int to string
Browse files Browse the repository at this point in the history
  • Loading branch information
MialLewis committed Sep 13, 2023
1 parent 0654763 commit ce432a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jenkins/jenkins.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"encoding/xml"
"io/ioutil"
"strconv"
)

type Client struct {
Expand Down Expand Up @@ -117,7 +118,7 @@ func (c *Client) BuildWithParameters(job string, parameters string) error {

func (c *Client) GetJobInstance(job string, pr_number int, sha string) (int, error) {
// set up the request
url := fmt.Sprintf("%s/job/%s/api/xml?tree=builds[number,result,actions[parameters[name,value]]]&xpath=/freeStyleProject/build[action/parameter[name=\"PR\"][value=\"%s\"]][action/parameter[name=\"GIT_SHA1\"][value=\"%s\"]][not(result)]&wrapper=found_jobs", c.Baseurl, job, pr_number, sha)
url := fmt.Sprintf("%s/job/%s/api/xml?tree=builds[number,result,actions[parameters[name,value]]]&xpath=/freeStyleProject/build[action/parameter[name=\"PR\"][value=\"%s\"]][action/parameter[name=\"GIT_SHA1\"][value=\"%s\"]][not(result)]&wrapper=found_jobs", c.Baseurl, job, strconv.Itoa(pr_number), sha)
req, err := http.NewRequest("GET", url, nil)
if err != nil {
return 0, err
Expand Down

0 comments on commit ce432a0

Please sign in to comment.