diff --git a/job.go b/job.go index 1936af79..f05b2279 100644 --- a/job.go +++ b/job.go @@ -127,6 +127,9 @@ func (j *Job) GetBuild(ctx context.Context, id int64) (*Build, error) { // "https:///jenkins/" is the server URL, // we are expecting jobURL = "job/JOB1" jobURL := strings.Replace(j.Raw.URL, j.Jenkins.Server, "", -1) + if strings.HasSuffix(jobURL, "/") { + jobURL = jobURL[:len(jobURL)-1] + } build := Build{Jenkins: j.Jenkins, Job: j, Raw: new(BuildResponse), Depth: 1, Base: jobURL + "/" + strconv.FormatInt(id, 10)} status, err := build.Poll(ctx) if err != nil {