From e5f10adbf59fea9f300fd079c009a8ac1d544c69 Mon Sep 17 00:00:00 2001 From: Kyle Harding Date: Mon, 30 Dec 2024 08:46:43 -0500 Subject: [PATCH] Enable support for workflow dispatch events These events include the same information as pull request events if they are triggered in the context of a PR. If they are triggered as a standalone workflow run, there will be no associated PRs to find matching reviews and they will remain unapproved. Change-type: patch Signed-off-by: Kyle Harding --- src/handlers/deployment-protection-rule.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/handlers/deployment-protection-rule.ts b/src/handlers/deployment-protection-rule.ts index ab79ea1..b96b44b 100644 --- a/src/handlers/deployment-protection-rule.ts +++ b/src/handlers/deployment-protection-rule.ts @@ -41,7 +41,14 @@ export async function handleDeploymentProtectionRule( return; } - if (!['pull_request', 'pull_request_target', 'push'].includes(event)) { + if ( + ![ + 'pull_request', + 'pull_request_target', + 'push', + 'workflow_dispatch', + ].includes(event) + ) { context.log.info( 'Ignoring unsupported deployment protection rule event: %s', event,