mirror of
https://github.com/appleboy/drone-jenkins.git
synced 2026-06-04 10:15:02 +08:00
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:
+1
-1
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user