diff --git a/.vscode/settings.json b/.vscode/settings.json index ec4140aac..61dedca9b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,5 +13,16 @@ }, "editor.formatOnSave": true, "debug.node.autoAttach": "on", - "cSpell.words": ["APIPR", "BITBUCKETSERVER", "Commenter", "JSONDSL", "PRDSL", "bitbucket", "jsome", "repo's"] + "cSpell.words": [ + "APIPR", + "BITBUCKETSERVER", + "Commenter", + "Filepaths", + "JSONDSL", + "PRDSL", + "bitbucket", + "jsome", + "keypaths", + "repo's" + ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index c4045aad4..81525253b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - Remove dead links to example danger files. - [@stevemoser][] - Allow danger-pr to work also on Bitbucket Server - [@f-meloni][] +- Fix for nulls in modified_files - [@orta][] # 7.0.4 diff --git a/README.md b/README.md index 5d2347bd1..8a2678f51 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,12 @@ yarn lint The fixers for both tslint and prettier will be applied when you commit, and on a push your code will be verified that it compiles. +You can run your dev copy of danger against a PR by running: + +```sh +yarn build; node --inspect distribution/source/commands/danger-pr.js https://github.com/danger/danger-js/pull/817 +``` + ### How does Danger JS work? Check the [architecture doc](https://github.com/danger/danger-js/blob/master/docs/architecture.md). diff --git a/source/platforms/git/diffToGitJSONDSL.ts b/source/platforms/git/diffToGitJSONDSL.ts index aa9588403..31c7a3663 100644 --- a/source/platforms/git/diffToGitJSONDSL.ts +++ b/source/platforms/git/diffToGitJSONDSL.ts @@ -16,7 +16,8 @@ export const diffToGitJSONDSL = (diff: string, commits: GitCommit[]): GitJSONDSL const modifiedDiffs = fileDiffs.filter((diff: any) => !includes(addedDiffs, diff) && !includes(removedDiffs, diff)) return { - modified_files: modifiedDiffs.map(d => d.to), + // Work around for danger/danger-js#807 + modified_files: modifiedDiffs.map(d => d.to || (d.from && d.from.split(" b/")[0])), created_files: addedDiffs.map(d => d.to), deleted_files: removedDiffs.map(d => d.from), commits: commits,