From 69fbfe983e808c43710f571da997b4c1b543228a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Mon, 25 Jul 2022 11:55:16 +0200 Subject: [PATCH] feat: configure excluded repositories Ref: https://github.com/timja/github-comment-ops/issues/54 --- app/router.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/router.js b/app/router.js index 6287b22..0d73be0 100644 --- a/app/router.js +++ b/app/router.js @@ -19,6 +19,15 @@ import { extractCommaSeparated, extractUsersAndTeams } from "./converters.js"; export async function router(auth, id, payload, verbose) { const sourceRepo = payload.repository.name; + + const excludedRepositories = process.env.EXCLUDED_REPOSITORIES.split(',') + if (excludedRepositories.includes(sourceRepo)) { + console.log( + `This ${sourceRepo} repository is excluded from github-comment-ops` + ); + return; + } + const transferMatches = transferMatcher(payload.comment.body); const actorRequest = `as requested by ${payload.sender.login}`; if (transferMatches) {