mirror of
https://github.com/anuraghazra/github-readme-stats.git
synced 2025-02-23 14:50:33 +08:00
ci: fix a bug in the theme preview action (#2549)
This commit is contained in:
parent
82224fa68a
commit
d5fbfb4345
@ -298,12 +298,13 @@ const themeNameAlreadyExists = (name) => {
|
|||||||
return themes[name] !== undefined;
|
return themes[name] !== undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const DRY_RUN = process.env.DRY_RUN === "true" || false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main function.
|
* Main function.
|
||||||
*/
|
*/
|
||||||
export const run = async (prNumber) => {
|
export const run = async (prNumber) => {
|
||||||
try {
|
try {
|
||||||
const dryRun = process.env.DRY_RUN === "true" || false;
|
|
||||||
debug("Retrieve action information from context...");
|
debug("Retrieve action information from context...");
|
||||||
debug(`Context: ${inspect(github.context)}`);
|
debug(`Context: ${inspect(github.context)}`);
|
||||||
let commentBody = `
|
let commentBody = `
|
||||||
@ -513,7 +514,7 @@ export const run = async (prNumber) => {
|
|||||||
// Create or update theme-preview comment.
|
// Create or update theme-preview comment.
|
||||||
debug("Create or update theme-preview comment...");
|
debug("Create or update theme-preview comment...");
|
||||||
let comment_url;
|
let comment_url;
|
||||||
if (!dryRun) {
|
if (!DRY_RUN) {
|
||||||
comment_url = await upsertComment(octokit, {
|
comment_url = await upsertComment(octokit, {
|
||||||
comment_id: comment?.id,
|
comment_id: comment?.id,
|
||||||
issue_number: pullRequestId,
|
issue_number: pullRequestId,
|
||||||
@ -535,7 +536,7 @@ export const run = async (prNumber) => {
|
|||||||
const reviewReason = themesValid
|
const reviewReason = themesValid
|
||||||
? undefined
|
? undefined
|
||||||
: INVALID_REVIEW_COMMENT(comment_url);
|
: INVALID_REVIEW_COMMENT(comment_url);
|
||||||
if (!dryRun) {
|
if (!DRY_RUN) {
|
||||||
await addReview(
|
await addReview(
|
||||||
octokit,
|
octokit,
|
||||||
pullRequestId,
|
pullRequestId,
|
||||||
@ -558,7 +559,7 @@ export const run = async (prNumber) => {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
debug("Set review state to `REQUEST_CHANGES` and add `invalid` label...");
|
debug("Set review state to `REQUEST_CHANGES` and add `invalid` label...");
|
||||||
if (!dryRun) {
|
if (!DRY_RUN) {
|
||||||
await addReview(
|
await addReview(
|
||||||
octokit,
|
octokit,
|
||||||
pullRequestId,
|
pullRequestId,
|
||||||
|
Loading…
Reference in New Issue
Block a user