From 249029d8487e7d75e9036d9266fd7b2d1b3a1472 Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Sat, 25 Feb 2023 15:14:47 +0100 Subject: [PATCH] ci: fix a bug in the theme preview action (#2549) --- scripts/preview-theme.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/preview-theme.js b/scripts/preview-theme.js index 38faf873ce3d5..aae892c602fdb 100644 --- a/scripts/preview-theme.js +++ b/scripts/preview-theme.js @@ -298,12 +298,13 @@ const themeNameAlreadyExists = (name) => { return themes[name] !== undefined; }; +const DRY_RUN = process.env.DRY_RUN === "true" || false; + /** * Main function. */ export const run = async (prNumber) => { try { - const dryRun = process.env.DRY_RUN === "true" || false; debug("Retrieve action information from context..."); debug(`Context: ${inspect(github.context)}`); let commentBody = ` @@ -513,7 +514,7 @@ export const run = async (prNumber) => { // Create or update theme-preview comment. debug("Create or update theme-preview comment..."); let comment_url; - if (!dryRun) { + if (!DRY_RUN) { comment_url = await upsertComment(octokit, { comment_id: comment?.id, issue_number: pullRequestId, @@ -535,7 +536,7 @@ export const run = async (prNumber) => { const reviewReason = themesValid ? undefined : INVALID_REVIEW_COMMENT(comment_url); - if (!dryRun) { + if (!DRY_RUN) { await addReview( octokit, pullRequestId, @@ -558,7 +559,7 @@ export const run = async (prNumber) => { } } catch (error) { debug("Set review state to `REQUEST_CHANGES` and add `invalid` label..."); - if (!dryRun) { + if (!DRY_RUN) { await addReview( octokit, pullRequestId,