Skip to content

Commit

Permalink
Fix isCI check for Codeship
Browse files Browse the repository at this point in the history
Update Codeship provider to refer to updated default environment variables
  • Loading branch information
Michael Steward committed Feb 25, 2019
1 parent 4a45c41 commit 3f39ee7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

<!-- Your comment below this -->

- Fixed: isCI check for Codeship - [@msteward]

# 7.0.14

- Fixed: Crash on BitbucketServer when the change type is unknown - [@f-meloni]
Expand Down Expand Up @@ -367,7 +369,7 @@ Also, `danger pr` now accepts a `--process` arg.
# 3.7.19

- Convert the `exec` in `danger local` to a `spawn` hopefully unblocking large diffs from going through it -
[@joshacheson] [@orta]
[@joshacheson][@orta]

# 3.7.18

Expand Down Expand Up @@ -795,8 +797,8 @@ You'll need to have [husky](https://www.npmjs.com/package/husky) installed for t
### 2.0.0-beta.2

- Fixes a bug with `danger.github.utils` in that it didn't work as of b1, and now it does :+1: - [@orta]
- Ships a `danger.js.flow` in the root of the project, this may be enough to support flow typing, thanks to
[@joarwilk] and [flowgen](https://github.com/joarwilk/flowgen) - [@orta]
- Ships a `danger.js.flow` in the root of the project, this may be enough to support flow typing, thanks to [@joarwilk]
and [flowgen](https://github.com/joarwilk/flowgen) - [@orta]

### 2.0.0-beta.1

Expand Down
8 changes: 6 additions & 2 deletions source/ci_source/providers/Codeship.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Env, CISource } from "../ci_source"
import { ensureEnvKeysExist, getPullRequestIDForBranch } from "../ci_source_helpers"

// https://documentation.codeship.com/pro/builds-and-configuration/environment-variables/
// Codeship Pro: https://documentation.codeship.com/pro/builds-and-configuration/environment-variables/
// Codeship Basic: https://documentation.codeship.com/basic/builds-and-configuration/set-environment-variables/

/**
* ### CI Setup
Expand Down Expand Up @@ -48,7 +49,10 @@ export class Codeship implements CISource {
}

get isCI(): boolean {
return ensureEnvKeysExist(this.env, ["CODESHIP"])
if (ensureEnvKeysExist(this.env, ["CI_NAME"]) && this.env.CI_NAME === "codeship") {
return true
}
return false
}

get isPR(): boolean {
Expand Down

0 comments on commit 3f39ee7

Please sign in to comment.