question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot start danger with checks API setup

See original GitHub issue

It looks like danger is not correctly set to run with Github Checks API only. I’m starting danger with command yarn danger ci --use-github-checks --text-only This is the stacktrace I’m getting:

The DANGER_GITHUB_API_TOKEN/DANGER_BITBUCKETSERVER_HOST environmental variable is missing
Without an api token, danger will be unable to comment on a PR
Error:  Error: Cannot use authenticated API requests.
    at Object.getPlatformForEnv (/home/circleci/project/node_modules/danger/distribution/platforms/platform.js:51:11)
    at Object.<anonymous> (/home/circleci/project/node_modules/danger/distribution/commands/ci/runner.js:81:57)
    at step (/home/circleci/project/node_modules/danger/distribution/commands/ci/runner.js:32:23)
    at Object.next (/home/circleci/project/node_modules/danger/distribution/commands/ci/runner.js:13:53)
    at fulfilled (/home/circleci/project/node_modules/danger/distribution/commands/ci/runner.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
error Command failed with exit code 1.

I have only DANGER_JS_APP_INSTALL_ID set in envirovment.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ggajewscommented, Mar 15, 2019

According to Changelog nope.

This brings some interesting architectural changes inside Danger, but more important to you dear reader, is that using the Checks API has some API restrictions. This makes in infeasible to re-use the user access token which we’ve previously been recommending for setup.

Instead there are two options: Use a GitHub app owned by Danger: https://github.com/apps/danger-js Use your own GitHub app. The security model of the GitHub app means it’s totally safe to use our GitHub app, it can only read/write to checks and has no access to code or organizational data. It’s arguably safer than the previous issue-based comment. To use it, you need to hit the above link, install the app on the org of your choice and then get the install ID from the URL you’re redirected to. Set that in your CI’s ENV to be DANGER_JS_APP_INSTALL_ID and you’re good to go.

0reactions
ortacommented, Apr 18, 2019

You’re welcome to take a look, we mostly use Danger via Peril (or in OSS repos using the access token) so I don’t really get this happening personally and I don’t have enough the time to fix bug for other folk and maintain this much oss

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Set Up - Danger.systems
Open this up in your editor, then replace the #gem 'rails' with the gem above. Then run bundle install inside your project folder....
Read more >
app.yaml Configuration File - Flexible Environment
This runtime does not support any App Engine APIs. ... The delay, in seconds, after the instance starts during which health check responses...
Read more >
External Status Checks API - GitLab Docs
Execute this API call as any user with rights to approve the merge request itself. POST /projects/:id/merge_requests/:merge_request_iid/ ...
Read more >
Docker security
When you start a container with docker run , behind the scenes Docker creates a set ... Of course, if the host system...
Read more >
Secrets | Kubernetes
If the Secret cannot be fetched (perhaps because it does not exist, or due to a temporary lack of connection to the API...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found