Skip to content

Commit

Permalink
ci: fix a bug in the theme preview action (anuraghazra#2549)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickstaa authored and tomy0000000 committed Feb 26, 2023
1 parent 4d9cf45 commit a8ab133
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/preview-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit a8ab133

Please sign in to comment.