danger / danger-js

⚠️ Stop saying "you forgot to …" in code review
http://danger.systems/js/
MIT License
5.29k stars 367 forks source link

Run `danger pr` on a specific commit in a PR #137

Open macklinu opened 7 years ago

macklinu commented 7 years ago

Use case: often times, a PR is opened with lint errors or danger failures, and those errors are quickly fixed and pushed up to GitHub. I would like to run danger pr against a specific commit in a PR that has danger errors instead of the latest commit, which is fixed.

Running a command like:

danger pr https://github.com/danger/danger-js/pull/99/commits/7fe319d55ce4195ab9c8d439414028b134a63eca

could test my dangerfile.js changes against 7fe319d55ce4195ab9c8d439414028b134a63eca (assuming there were some danger failures in those code changes).

This would be an alternative to running:

export DANGER_FAKE_CI="YEP"
export DANGER_GITHUB_API_TOKEN='xxxxxxxxxx'  # a github api token
export DANGER_TEST_REPO='danger/danger-js'
git checkout branch-for-pr-99
DANGER_TEST_PR='99' npm run danger

which would leave a comment on the PR in GitHub.

Thoughts?

orta commented 7 years ago

Yeah, sounds good - just make sure it's well documented in the --help for danger pr 👍