From c1421bf23074329a1361d2626fa6bc11d8ced52b Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Wed, 15 Aug 2018 21:59:42 -0400 Subject: [PATCH] Adds an option to skip the checks API when using peril via setting SKIP_CHECKS_SUPPORT to true in the env --- source/danger/peril_platform.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/danger/peril_platform.ts b/source/danger/peril_platform.ts index ed5ca0bc..45e4c790 100644 --- a/source/danger/peril_platform.ts +++ b/source/danger/peril_platform.ts @@ -9,6 +9,8 @@ import { import { Platform } from "danger/distribution/platforms/platform" import { RunType } from "./danger_run" +const { SKIP_CHECKS_SUPPORT } = process.env + /** * When Peril is running a dangerfile for a PR we can use the default GitHub from Danger * however, an event like an issue comment or a user creation has no way to provide any kind of @@ -37,7 +39,9 @@ export const getPerilPlatformForDSL = (type: RunType, github: GitHubType | null, getFileContents: github ? github.getFileContents.bind(github) : nullFunc, // Checks Support platformResultsPreMapper: () => - github ? github.platformResultsPreMapper && github.platformResultsPreMapper.bind(github) : nullFunc, + github + ? !SKIP_CHECKS_SUPPORT && github.platformResultsPreMapper && github.platformResultsPreMapper.bind(github) + : nullFunc, // deprecated, and not used to my knowledge handlePostingResults: () =>