danger / danger/danger-js

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

Open
#137 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
5.5k
Forks
381
Avg merge
2h 8m
Merged PRs (30d)
6

Description

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:

```sh
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:

```sh
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?

Contributor guide

Open the contributing guide

Research direction

Start at the CLI entry point for `danger pr` and trace how a pull-request URL is parsed and resolved. Compare the requested commit URL behavior with the existing PR command; done means the command evaluates the specified commit while preserving the current latest-commit behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, typescript
Domain
api, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.