From 52298c6b7de7ec9180c22efc41cdbfd7564bbe60 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Thu, 27 Jun 2024 13:39:05 -0500 Subject: [PATCH] chore: Change `label` field to be required for temp envs --- dist/index.js | 3 ++- src/index.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 825d187..6610c8a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -36944,7 +36944,8 @@ try { // Temp environments enabled if (github.context.eventName === "pull_request") { const prEvent = github.context.payload; - const targetLabel = value.label || prEvent.label?.name; + const targetLabel = value.label; + if (!targetLabel) continue; const hasLabel = (prEvent.action === "labeled" && prEvent.label.name === targetLabel) || diff --git a/src/index.js b/src/index.js index 2ae1444..60d5f0d 100644 --- a/src/index.js +++ b/src/index.js @@ -31,7 +31,8 @@ try { // Temp environments enabled if (github.context.eventName === "pull_request") { const prEvent = github.context.payload; - const targetLabel = value.label || prEvent.label?.name; + const targetLabel = value.label; + if (!targetLabel) continue; const hasLabel = (prEvent.action === "labeled" && prEvent.label.name === targetLabel) ||