diff --git a/package.json b/package.json index 555a6616..c8a08e54 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "cookie": "^0.3.1", "cookie-parser": "^1.4.3", "cors": "^2.8.4", - "danger": "^3.8.4", + "danger": "^3.8.6", "danger-plugin-yarn": "^1.3.0", "dotenv": "^5.0.1", "ejs": "^2.5.9", diff --git a/source/danger/append_peril.ts b/source/danger/append_peril.ts index ceb94a92..2a3c0e14 100644 --- a/source/danger/append_peril.ts +++ b/source/danger/append_peril.ts @@ -2,7 +2,10 @@ import * as NodeGithub from "@octokit/rest" import { PerilDSL } from "danger/distribution/dsl/DangerDSL" import { GitHubUtilsDSL } from "danger/distribution/dsl/GitHubDSL" -import GitHubUtils, { createUpdatedIssueWithIDGenerator } from "danger/distribution/platforms/github/GitHubUtils" +import GitHubUtils, { + createOrAddLabel, + createUpdatedIssueWithIDGenerator, +} from "danger/distribution/platforms/github/GitHubUtils" import { DangerContext } from "danger/distribution/runner/Dangerfile" import { href, sentence } from "danger/distribution/runner/DangerUtils" @@ -72,6 +75,9 @@ const recreateGitHubUtils = (api: NodeGithub): GitHubUtilsDSL => ({ }, createUpdatedIssueWithID: createUpdatedIssueWithIDGenerator(api), + // TODO: Is this right? + // Do I need to move the PR object into here if needed? + createOrAddLabel: createOrAddLabel(undefined as any, api), }) /** diff --git a/source/danger/peril_platform.ts b/source/danger/peril_platform.ts index ba6d9c47..ed5ca0bc 100644 --- a/source/danger/peril_platform.ts +++ b/source/danger/peril_platform.ts @@ -2,6 +2,7 @@ import { GitHubUtilsDSL } from "danger/distribution/dsl/GitHubDSL" import { GitHubType } from "danger/distribution/platforms/GitHub" import { + createOrAddLabel, createUpdatedIssueWithIDGenerator, fileContentsGenerator, } from "danger/distribution/platforms/github/GitHubUtils" @@ -25,6 +26,7 @@ export const getPerilPlatformForDSL = (type: RunType, github: GitHubType | null, const utils: GitHubUtilsDSL | null = github && { fileContents: fileContentsGenerator(github.api.getExternalAPI(), repoSlug, ref), createUpdatedIssueWithID: createUpdatedIssueWithIDGenerator(github.api.getExternalAPI()), + createOrAddLabel: createOrAddLabel(undefined as any, github.api.getExternalAPI()), // Not sure what this looks like for non-PR events fileLinks: (paths, _, __, ___) => paths.join(", "), } diff --git a/yarn.lock b/yarn.lock index 53c15bab..f14a39a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,9 +17,9 @@ core-js "^2.5.3" regenerator-runtime "^0.11.1" -"@octokit/rest@^15.5.0": - version "15.6.0" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-15.6.0.tgz#2d4a9f9efd38513b606f3192d91bac216c1c6d94" +"@octokit/rest@^15.9.5": + version "15.9.5" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-15.9.5.tgz#e356d202bd0b517e381f705ad77d98ccb84e0c65" dependencies: before-after-hook "^1.1.0" btoa-lite "^1.0.0" @@ -2378,11 +2378,11 @@ danger-plugin-yarn@^1.3.0: optionalDependencies: esdoc "^0.5.2" -danger@^3.8.4: - version "3.8.4" - resolved "https://registry.yarnpkg.com/danger/-/danger-3.8.4.tgz#e84b8398a3b7dd5707d7628a833f529efa4d1354" +danger@^3.8.6: + version "3.8.6" + resolved "https://registry.yarnpkg.com/danger/-/danger-3.8.6.tgz#6760e17a191e0b0e5a255cc9389a0f303033950d" dependencies: - "@octokit/rest" "^15.5.0" + "@octokit/rest" "^15.9.5" babel-polyfill "^6.23.0" chalk "^2.3.0" commander "^2.13.0"