danger / danger/danger-js

GithubUtils: fileContents throwing error

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

Description

Using the following `dangerfile.js` (ignore hard coded values ☺️):

```js
"use strict";

schedule(async function() {
const fileContents = await danger
.git
.created_files
.map(p => danger.github.utils.fileContents(p, "danger/danger-js", "relative_files"))

console.log(fileContents);
})
```

And running the command:

```sh
$ yarn danger pr https://github.com/danger/danger-js/pull/359
```

I'm seeing the following error:

```
TypeError: this.getFileContents is not a function
```

-------------

Been trying to debug but can't quite find the why this would be failing: https://github.com/danger/danger-js/blob/b6348da0eab7935ccbc2c68082ed558fa052c4dc/source/platforms/github/GitHubAPI.ts#L72-L74

I hope it's not my local env (installed it via yarn) and should be easily reproducible with the above.

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.