UNPKG

dangerjs-wrapper

Version:

Plugin to Apply cultural rules during your CI process.

15 lines (14 loc) 647 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkTicketLinkInPrBoby = void 0; const checkTicketLinkInPrBoby = (dangerConfig) => { var _a, _b; const { ticketLinkRegExp } = dangerConfig; const defaultRegExp = /https:\/\/dev.azure.com/g; if (!((_b = (_a = danger.github) === null || _a === void 0 ? void 0 : _a.pr) === null || _b === void 0 ? void 0 : _b.body.match(ticketLinkRegExp || defaultRegExp))) { fail('You should add the associated ticket/s to the Pull request body'); return false; } return true; }; exports.checkTicketLinkInPrBoby = checkTicketLinkInPrBoby;