danger / danger-plugin-template

An opinionated template for creating a Danger plugin
Other
20 stars 10 forks source link

Unable to run tests for plugin remote on GitHub Enterprise #17

Open liamnichols opened 6 years ago

liamnichols commented 6 years ago

I'm writing a plugin who's repo is hosted on a private GHE instance and when I run bundle exec rake spec I am presented with the following

➜  danger-localized_strings git:(master) ✗ bundle exec rake spec
/Users/liamnichols/.rbenv/versions/2.3.6/bin/ruby -I/Users/liamnichols/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib:/Users/liamnichols/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/rspec-support-3.7.1/lib /Users/liamnichols/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
.
Could not set up API to Code Review site for Danger

For Danger to run on this project, you need to expose a set of following the ENV vars:
 - GitHub: DANGER_GITHUB_API_TOKEN
 - GitLab: DANGER_GITLAB_API_TOKEN
 - BitbucketServer: DANGER_BITBUCKETSERVER_USERNAME, DANGER_BITBUCKETSERVER_PASSWORD, DANGER_BITBUCKETSERVER_HOST
 - BitbucketCloud: DANGER_BITBUCKETCLOUD_USERNAME, DANGER_BITBUCKETCLOUD_PASSWORD
 - VSTS: DANGER_VSTS_API_TOKEN, DANGER_VSTS_HOST

Found these keys in your ENV: HAS_JOSH_K_SEAL_OF_APPROVAL, TRAVIS_PULL_REQUEST, TRAVIS_REPO_SLUG, TRAVIS_COMMIT_RANGE, DANGER_GITHUB_API_TOKEN.

Failing the build, Danger cannot run without API access.
You can see more information at http://danger.systems/guides/getting_started.html

I found #7 as this has a similar effect and after some digging, I realised it is because danger checks for a remote named origin to look for the repo name when detecting the host.