Repository: excalidraw/excalidraw
File: scripts/autorelease.js (JavaScript)

Code before:
const publish = () => {
  try {
    execSync(`yarn  --frozen-lockfile`);
    execSync(`yarn --frozen-lockfile`, { cwd: excalidrawDir });
    execSync(`yarn run build:umd`, { cwd: excalidrawDir });
    execSync(`yarn --cwd ${excalidrawDir} publish`);
    console.info("Published 🎉");
    core.setOutput(
      "result",
      `**Preview version has been shipped** :rocket:
    You can use [@excalidraw/excalidraw-preview@${pkg.version}](https://www.npmjs.com/package/@excalidraw/excalidraw-preview/v/${pkg.version}) for testing!`,
    );
  } catch (error) {
    core.setOutput("result", "package couldn't be published :warning:!");
    console.error(error);
    process.exit(1);
  }
};
// get files changed between prev and head commit
exec(`git diff --name-only HEAD^ HEAD`, async (error, stdout, stderr) => {
  if (error || stderr) {
    console.error(error);
    core.setOutput("result", ":warning: Package couldn't be published!");
    process.exit(1);
  }
  console.info(stdout, "stdout");
  const changedFiles = stdout.trim().split("\n");
  const filesToIgnoreRegex = /src\/excalidraw-app|packages\/utils/;

  const excalidrawPackageFiles = changedFiles.filter((file) => {
    return (
      (file.indexOf("src") >= 0 || file.indexOf("package.json")) >= 0 &&
      !filesToIgnoreRegex.test(file)
    );
  });
  if (!excalidrawPackageFiles.length) {
    console.info("Skipping release as no valid diff found");
    core.setOutput("result", "Skipping release as no valid diff found");
    process.exit(0);
  }

  // update package.json
  pkg.version = `${pkg.version}-${getShortCommitHash()}`;
  pkg.name = "@excalidraw/excalidraw-next";
  // update readme
  let data = fs.readFileSync(`${excalidrawDir}/README_NEXT.md`, "utf8");

  const isPreview = process.argv.slice(2)[0] === "preview";
  console.info("isPreview", isPreview);
  if (isPreview) {
    // use pullNumber-commithash as the version for preview

Review comment (bug):
```suggestion
```

I assume a forgotten debug statement

Code after:
const publish = () => {
  try {
    execSync(`yarn  --frozen-lockfile`);
    execSync(`yarn --frozen-lockfile`, { cwd: excalidrawDir });
    execSync(`yarn run build:umd`, { cwd: excalidrawDir });
    execSync(`yarn --cwd ${excalidrawDir} publish`);
    console.info("Published 🎉");
    core.setOutput(
      "result",
      `**Preview version has been shipped** :rocket:
    You can use [@excalidraw/excalidraw-preview@${pkg.version}](https://www.npmjs.com/package/@excalidraw/excalidraw-preview/v/${pkg.version}) for testing!`,
    );
  } catch (error) {
    core.setOutput("result", "package couldn't be published :warning:!");
    console.error(error);
    process.exit(1);
  }
};
// get files changed between prev and head commit
exec(`git diff --name-only HEAD^ HEAD`, async (error, stdout, stderr) => {
  if (error || stderr) {
    console.error(error);
    core.setOutput("result", ":warning: Package couldn't be published!");
    process.exit(1);
  }
  const changedFiles = stdout.trim().split("\n");
  const filesToIgnoreRegex = /src\/excalidraw-app|packages\/utils/;

  const excalidrawPackageFiles = changedFiles.filter((file) => {
    return (
      (file.indexOf("src") >= 0 || file.indexOf("package.json")) >= 0 &&
      !filesToIgnoreRegex.test(file)
    );
  });
  if (!excalidrawPackageFiles.length) {
    console.info("Skipping release as no valid diff found");
    core.setOutput("result", "Skipping release as no valid diff found");
    process.exit(0);
  }

  // update package.json
  pkg.name = "@excalidraw/excalidraw-next";
  let version = `${pkg.version}-${getShortCommitHash()}`;

  // update readme
  let data = fs.readFileSync(`${excalidrawDir}/README_NEXT.md`, "utf8");

  const isPreview = process.argv.slice(2)[0] === "preview";
  if (isPreview) {
    // use pullNumber-commithash as the version for preview
    const pullRequestNumber = process.argv.slice(3)[0];