pkg-pr-new 0.0.7 → 0.0.8

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.
package/index.ts CHANGED
@@ -20,7 +20,8 @@ declare global {
20
20
  var API_URL: string;
21
21
  }
22
22
 
23
- const publishUrl = new URL("/publish", API_URL);
23
+ const apiUrl = process.env.API_URL ?? API_URL
24
+ const publishUrl = new URL("/publish", apiUrl);
24
25
 
25
26
  const main = defineCommand({
26
27
  meta: {
@@ -72,14 +73,11 @@ const main = defineCommand({
72
73
  process.exit(1);
73
74
  }
74
75
 
75
- new Octokit(); // gh authentication
76
-
77
76
  const {
78
77
  GITHUB_REPOSITORY,
79
78
  GITHUB_RUN_ID,
80
79
  GITHUB_RUN_ATTEMPT,
81
80
  GITHUB_ACTOR_ID,
82
- GITHUB_JOB
83
81
  } = process.env;
84
82
 
85
83
  const [owner, repo] = GITHUB_REPOSITORY.split("/");
@@ -87,15 +85,14 @@ const main = defineCommand({
87
85
  const metadata = {
88
86
  owner,
89
87
  repo,
90
- job: GITHUB_JOB,
91
- runId: Number(GITHUB_RUN_ID),
88
+ run: Number(GITHUB_RUN_ID),
92
89
  attempt: Number(GITHUB_RUN_ATTEMPT),
93
90
  actor: Number(GITHUB_ACTOR_ID),
94
91
  };
95
92
 
96
93
  const key = hash(metadata);
97
94
 
98
- const checkResponse = await fetch(new URL("/check", API_URL), {
95
+ const checkResponse = await fetch(new URL("/check", apiUrl), {
99
96
  method: "POST",
100
97
  body: JSON.stringify({
101
98
  owner,
@@ -129,7 +126,7 @@ const main = defineCommand({
129
126
  pJson.name,
130
127
  new URL(
131
128
  `/${owner}/${repo}/${pJson.name}@${sha}`,
132
- API_URL,
129
+ apiUrl,
133
130
  ).href,
134
131
  );
135
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pkg-pr-new",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
Binary file