Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not a Drone Pull Request - skipping danger run #1373

Open
scottyab opened this issue Jun 16, 2022 · 4 comments
Open

Not a Drone Pull Request - skipping danger run #1373

scottyab opened this issue Jun 16, 2022 · 4 comments

Comments

@scottyab
Copy link

scottyab commented Jun 16, 2022

Report

What did you do?

Added the following to my Drone.yml in the default pipeline

 - name: run Danger PR validator
    image: dangersystems/danger-rb
    depends_on:
      - test
    commands:
      - bundle exec danger --fail-on-errors=true --new-comment --remove-previous-comments
    environment:
      DANGER_GITHUB_API_TOKEN:
        from_secret: DANGER_GITHUB_API_TOKEN
    when:
      event:
        include:
          - push
          - pull_request

What did you expect to happen?

Created a PR and expected Danger to run and analyse the Pull Request

What happened instead?

Console log from the " run Danger PR validator" Drone step

latest: Pulling from dangersystems/danger-rb
Digest: sha256: blahblahblah
Status: Downloaded newer image for dangersystems/danger-rb:latest
+ bundle exec danger --fail-on-errors=true --new-comment --remove-previous-comments
Not a Drone Pull Request - skipping `danger` run.

Your Environment

  • Which CI are you running on? DroneCI

  • Are you running the latest version of Danger? 8.6.1

  • What is your Dangerfile?
    I'm just trying to get this hooked up to Drone so ATM my danger file is just

      warn("Hello from Danger :) ")

Thanks for the tool, its really useful, have successfully used it with Bitrise.io and this is my first time using with Drone.

@scottyab
Copy link
Author

Hmmm... potentially this issue is on Drone or my setup of it. Seems DRONE_PULL_REQUEST is not being set, if hardcode the DRONE_PULL_REQUEST env var, danger will run aok.

environment
       # hardcoded the DRONE_PULL_REQUEST to get Danager to run
	DRONE_PULL_REQUEST: 1

@orta
Copy link
Member

orta commented Jun 18, 2022

Perhaps drone doesn't set the same PR variables as before? I've never used Drone so it's kinda on you to figure this one I'm afraid

@scottyab
Copy link
Author

Thanks @orta from the docs it seems DRONE_PULL_REQUEST is still valid, so I guess this must be more of a local issue with our setup?

As mentioned above if hardcode the DRONE_PULL_REQUEST Danger runs but it doesn't post to the actual PR I'm guessing as theDRONE_PULL_REQUEST is used elsewhere to actually post the messages. 🤔

@manicmaniac
Copy link
Member

Not a Pull Request - skipping danger run is a common error when you run CI workflow before creating a pull request.

Please make sure your CI workflow runs after creating a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants