danger-js icon indicating copy to clipboard operation
danger-js copied to clipboard

Unable to run Danger without fake_ci

Open eyald-ma opened this issue 4 years ago • 3 comments

Hi, I'm using Jenkins multi-branch pipeline(scripted) with Github using Branch Sources.

Whenever I try to run Danger with the following environment variables: DANGER_GITHUB_API_TOKEN, DANGER_TEST_PR, DANGER_TEST_REPO, FAKE_CI='yep' I'm getting the result I should have, and the comment I expect in git.

Without FAKE_CI, I'm getting the message "Skipping Danger due to this run not executing on a PR."

Could you please provide a list of environment variables Danger expects? Does "GitHub Pull Request Builder" is a must? Do you support another plugin? In case PR builder i a must, can I have an example for scripted pipeline under multi-branch pipeline?

To Reproduce Steps to reproduce the behavior:

  1. Set Dangerfile
  2. Run "npm run danger" without FAKE_CI='YEP'

** Your Environment** Jenkins - 2.204.2 Multibranch, scripted pipeline

eyald-ma avatar May 10 '20 11:05 eyald-ma

I've never used Jenkins with danger myself, so if the getting started docs aren't good enough then I'd recommend reading the source for the Jenkins provider in this repo 👍

orta avatar May 12 '20 00:05 orta

Danger is useful only on pull requests, otherwise it skips executing. You can run npm run danger local which will execute and print output to console without URL to Pull Request.

HonzaMac avatar May 12 '20 07:05 HonzaMac

A. I'm seeing this issue as of a week or two back, with Nevercode CI B. I'm not seeing this issue for Github Actions

Not sure if this suggests that something is wrong in my Nevercode Environment, or if something happened inside DangerJS.

We're on [email protected]

fbartho avatar May 14 '20 23:05 fbartho