danger / danger/danger-js

Feature: provider-agnostic API to fetch file contents of a different ref

Open
#1,108 6 comments 0 reactions 0 assignees View on GitHub
You Can Do This
Dominant language
TypeScript
Stars
5.5k
Forks
381
Avg merge
2h 8m
Merged PRs (30d)
6

Description

**Describe the bug**
`danger.github` is undefined.

```shell
Cannot read property 'pr' of undefined
TypeError: Cannot read property 'pr' of undefined
at dangerfile.js:5:62
```

**To Reproduce**
- `git clone https://github.com/edno/danger-github-undefined.git`
- `cd danger-github-undefined`
- `yarn install` (Yarn 2)
- `git checkout new-branch`
- `yarn danger local -b main`

**Expected behavior**
This should display

```js
message(`:tada: The PR added ${additions} and removed ${deletions} lines.`)
```

**Environment**

| software | version
| ---------------- | -------
| danger.js | ^10.6.2
| node | v12.18.3
| yarn | 2.4.0
| Operating System | MacOS 11.2.1

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure from dangerfile.js using the listed danger local -b main command and the danger-github-undefined example repository. Investigate why danger.github is unavailable in that run, then verify that danger.github.pr can be accessed and the expected additions/deletions message is displayed.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.