chore(api): check Jenkins response status (#39)

When triggering a Jenkins job, Jenkins API call returns 200 OK but drone-jenkins expects 201.  So, the trigger succeeded but drone-jenkins returns false negative.
This commit is contained in:
Steve Liang
2025-12-01 00:29:54 -08:00
committed by GitHub
parent 3eb2242053
commit a6d967789d
+1 -1
View File
@@ -94,7 +94,7 @@ func (jenkins *Jenkins) post(path string, params url.Values, body interface{}) (
return
}
if resp.StatusCode != http.StatusCreated {
if resp.StatusCode != http.StatusCreated && resp.StatusCode != http.StatusOK {
return fmt.Errorf("unexpected response code: %d", resp.StatusCode)
}