danger / danger/danger-js

danger.github.utils.fileContents fails

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

Description

* danger.github.utils.fileContents worked fine in version 3.x.
* Upgraded to version 6.1.8 and got the error below.
* Had to downgrade to 4.4.10 where it seems to work again, but with a octokit deprecation warning.

Has there been any breaking changes to this function between version 4 and 6? 🙂

The following line fails:
`let fileContentsPromise = danger.github.utils.fileContents('somefile.txt');`

With the following error:
```
Cannot read property 'filename' of undefined
TypeError: Cannot read property 'filename' of undefined
at exports.shouldUseGitHubOverride (C:\GIT\*******\node_modules\danger\distribution\platforms\github\customGitHubRequir

e.js:120:16)
at Function._module2.default._load (C:\GIT\*******\node_modules\override-require\dist\overrideRequire.js:38:9)
at Object. (dangerfile.ts:5:29)
at Module._compile (module.js:652:30)
at Object.requireFromString [as default] (C:\GIT\*******\node_modules\require-from-string\index.js:28:4)
at Object. (C:\GIT\*******\node_modules\danger\distribution\runner\runners\inline.js:144:63)
`
at step (C:\GIT\*******\node_modules\danger\distribution\runner\runners\inline.js:32:23)
at Object.next (C:\GIT\*******\node_modules\danger\distribution\runner\runners\inline.js:13:53)
at C:\GIT\*******\node_modules\danger\distribution\runner\runners\inline.js:7:71
at new Promise ()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.