@ucdjs/release-scripts 0.1.0-beta.7 → 0.1.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +6 -4
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -56,15 +56,15 @@ function exitWithError(message, hint) {
56
56
  process.exit(1);
57
57
  }
58
58
  function normalizeSharedOptions(options) {
59
- const { workspaceRoot = process.cwd(), githubToken = "", verbose = false, repo, packages = true, prompts: prompts$1 = {
59
+ const { workspaceRoot = process.cwd(), githubToken = "", verbose = false, repo: fullRepo, packages = true, prompts: prompts$1 = {
60
60
  packages: true,
61
61
  versions: true
62
62
  },...rest } = options;
63
63
  globalOptions.verbose = verbose;
64
64
  if (!githubToken.trim()) exitWithError("GitHub token is required", "Set GITHUB_TOKEN environment variable or pass it in options");
65
- if (!repo || !repo.trim() || !repo.includes("/")) exitWithError("Repository (repo) is required", "Specify the repository in 'owner/repo' format (e.g., 'octocat/hello-world')");
66
- const [owner, name] = options.repo.split("/");
67
- if (!owner || !name) exitWithError(`Invalid repo format: "${options.repo}"`, "Expected format: \"owner/repo\" (e.g., \"octocat/hello-world\")");
65
+ if (!fullRepo || !fullRepo.trim() || !fullRepo.includes("/")) exitWithError("Repository (repo) is required", "Specify the repository in 'owner/repo' format (e.g., 'octocat/hello-world')");
66
+ const [owner, repo] = fullRepo.split("/");
67
+ if (!owner || !repo) exitWithError(`Invalid repo format: "${fullRepo}"`, "Expected format: \"owner/repo\" (e.g., \"octocat/hello-world\")");
68
68
  return {
69
69
  ...rest,
70
70
  packages,
@@ -342,6 +342,7 @@ async function pushBranch(branch, workspaceRoot, options) {
342
342
  //#region src/github.ts
343
343
  async function getExistingPullRequest({ owner, repo, branch, githubToken }) {
344
344
  try {
345
+ logger.debug(`Requesting pull request for branch: ${branch} (url: https://api.github.com/repos/${owner}/${repo}/pulls?state=open&head=${branch})`);
345
346
  const res = await fetch(`https://api.github.com/repos/${owner}/${repo}/pulls?state=open&head=${branch}`, { headers: {
346
347
  Accept: "application/vnd.github.v3+json",
347
348
  Authorization: `token ${githubToken}`
@@ -379,6 +380,7 @@ async function upsertPullRequest({ owner, repo, title, body, head, base, pullNum
379
380
  head,
380
381
  base
381
382
  };
383
+ logger.debug(`${isUpdate ? "Updating" : "Creating"} pull request (url: ${url})`);
382
384
  const res = await fetch(url, {
383
385
  method,
384
386
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucdjs/release-scripts",
3
- "version": "0.1.0-beta.7",
3
+ "version": "0.1.0-beta.9",
4
4
  "description": "@ucdjs release scripts",
5
5
  "type": "module",
6
6
  "license": "MIT",