Skip to content

Commit 1ccaff0

Browse files
committed
ci: fix a bug in the theme preview action
1 parent f9fea34 commit 1ccaff0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/preview-theme.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,13 @@ const themeNameAlreadyExists = (name) => {
298298
return themes[name] !== undefined;
299299
};
300300

301+
const DRY_RUN = process.env.DRY_RUN === "true" || false;
302+
301303
/**
302304
* Main function.
303305
*/
304306
export const run = async (prNumber) => {
305307
try {
306-
const dryRun = process.env.DRY_RUN === "true" || false;
307308
debug("Retrieve action information from context...");
308309
debug(`Context: ${inspect(github.context)}`);
309310
let commentBody = `
@@ -513,7 +514,7 @@ export const run = async (prNumber) => {
513514
// Create or update theme-preview comment.
514515
debug("Create or update theme-preview comment...");
515516
let comment_url;
516-
if (!dryRun) {
517+
if (!DRY_RUN) {
517518
comment_url = await upsertComment(octokit, {
518519
comment_id: comment?.id,
519520
issue_number: pullRequestId,
@@ -535,7 +536,7 @@ export const run = async (prNumber) => {
535536
const reviewReason = themesValid
536537
? undefined
537538
: INVALID_REVIEW_COMMENT(comment_url);
538-
if (!dryRun) {
539+
if (!DRY_RUN) {
539540
await addReview(
540541
octokit,
541542
pullRequestId,
@@ -558,7 +559,7 @@ export const run = async (prNumber) => {
558559
}
559560
} catch (error) {
560561
debug("Set review state to `REQUEST_CHANGES` and add `invalid` label...");
561-
if (!dryRun) {
562+
if (!DRY_RUN) {
562563
await addReview(
563564
octokit,
564565
pullRequestId,

0 commit comments

Comments
 (0)