Skip to content

Commit

Permalink
[WIP] Try using BitbucketServer Template
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloCore committed Jun 23, 2019
1 parent 55f4a70 commit 489b5d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion source/commands/danger-pr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ program
if (
!process.env["DANGER_GITHUB_API_TOKEN"] &&
!process.env["DANGER_BITBUCKETSERVER_HOST"] &&
!process.env["DANGER_BITBUCKETCLOUD_USERNAME"] &&
!gitLabApiCredentials.token
) {
log("")
log(
" You don't have a DANGER_GITHUB_API_TOKEN/DANGER_GITLAB_API_TOKEN set up, this is optional, but TBH, you want to do this."
" You don't have a DANGER_GITHUB_API_TOKEN/DANGER_GITLAB_API_TOKEN/DANGER_BITBUCKETCLOUD_USERNAME set up, this is optional, but TBH, you want to do this."
)
log(" Check out: http://danger.systems/js/guides/the_dangerfile.html#working-on-your-dangerfile")
log("")
Expand Down
8 changes: 5 additions & 3 deletions source/runner/Executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,11 @@ export class Executor {
} else {
const commitID = git.commits[git.commits.length - 1].sha
// TODO: GitLab template formatting (or reuse one of the others?)
const comment = process.env["DANGER_BITBUCKETSERVER_HOST"]
? bitbucketServerTemplate(dangerID, commitID, mergedResults)
: githubResultsTemplate(dangerID, commitID, mergedResults)
// Try using bitbucketServerTemplate for bitbucketCloud
const comment =
process.env["DANGER_BITBUCKETSERVER_HOST"] || process.env["DANGER_BITBUCKETCLOUD_USERNAME"]
? bitbucketServerTemplate(dangerID, commitID, mergedResults)
: githubResultsTemplate(dangerID, commitID, mergedResults)

issueURL = await this.platform.updateOrCreateComment(dangerID, comment)
this.log(`Feedback: ${issueURL}`)
Expand Down

0 comments on commit 489b5d4

Please sign in to comment.