diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ae56a587..b043436b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ ## Master +- Fix handling a `"pending"` status update properly using Bitbucket API - [@sgtcoolguy][] - Fix #614 - Posting status updates to Github using issue workflow broken - [@sgtcoolguy][] - Fix vertical alignment in GitHub issue template - [@patrickkempff][] diff --git a/source/platforms/BitBucketServer.ts b/source/platforms/BitBucketServer.ts index 80baac5ca..bc11affe6 100644 --- a/source/platforms/BitBucketServer.ts +++ b/source/platforms/BitBucketServer.ts @@ -42,9 +42,13 @@ export class BitBucketServer implements Platform { updateStatus = async (passed: boolean | "pending", message: string, url?: string): Promise => { const pr = await this.api.getPullRequestInfo() const { latestCommit } = pr.fromRef + let state = passed ? "SUCCESSFUL" : "FAILED" + if (passed === "pending") { + state = "INPROGRESS" + } try { await this.api.postBuildStatus(latestCommit, { - state: passed ? "SUCCESSFUL" : "FAILED", + state: state, key: "danger.systems", name: process.env["PERIL_INTEGRATION_ID"] ? "Peril" : "Danger", url: url || "http://danger.systems/js",