pkg-pr-new 0.0.58 → 0.0.59
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/dist/index.js +19 -4
- package/environments.ts +2 -0
- package/index.ts +14 -2
- package/package.json +1 -1
package/environments.ts
CHANGED
|
@@ -30,6 +30,8 @@ declare global {
|
|
|
30
30
|
GITHUB_JOB: string;
|
|
31
31
|
// A unique number for each attempt of a particular workflow run in a repository. This number begins at 1 for the workflow run's first attempt, and increments with each re-run. For example, 3.
|
|
32
32
|
GITHUB_RUN_ATTEMPT: string;
|
|
33
|
+
// A file to set action outputs
|
|
34
|
+
GITHUB_OUTPUT: string;
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
}
|
package/index.ts
CHANGED
|
@@ -164,6 +164,7 @@ const main = defineCommand({
|
|
|
164
164
|
GITHUB_RUN_ID,
|
|
165
165
|
GITHUB_RUN_ATTEMPT,
|
|
166
166
|
GITHUB_ACTOR_ID,
|
|
167
|
+
GITHUB_OUTPUT,
|
|
167
168
|
} = process.env;
|
|
168
169
|
|
|
169
170
|
const [owner, repo] = GITHUB_REPOSITORY.split("/");
|
|
@@ -193,6 +194,7 @@ const main = defineCommand({
|
|
|
193
194
|
}
|
|
194
195
|
|
|
195
196
|
const { sha } = await checkResponse.json();
|
|
197
|
+
const formattedSha = isCompact ? abbreviateCommitHash(sha) : sha;
|
|
196
198
|
|
|
197
199
|
const deps: Map<string, string> = new Map(); // pkg.pr.new versions of the package
|
|
198
200
|
const realDeps: Map<string, string> | null = isPeerDepsEnabled
|
|
@@ -225,8 +227,6 @@ const main = defineCommand({
|
|
|
225
227
|
if (isCompact) {
|
|
226
228
|
await verifyCompactMode(pJson.name);
|
|
227
229
|
}
|
|
228
|
-
|
|
229
|
-
const formattedSha = isCompact ? abbreviateCommitHash(sha) : sha;
|
|
230
230
|
const longDepUrl = new URL(
|
|
231
231
|
`/${owner}/${repo}/${pJson.name}@${formattedSha}`,
|
|
232
232
|
apiUrl,
|
|
@@ -552,6 +552,18 @@ const main = defineCommand({
|
|
|
552
552
|
await fs.writeFile(jsonFilePath, output);
|
|
553
553
|
console.warn(`metadata written to ${jsonFilePath}`);
|
|
554
554
|
}
|
|
555
|
+
|
|
556
|
+
await fs.appendFile(GITHUB_OUTPUT, `sha=${formattedSha}\n`, "utf8");
|
|
557
|
+
await fs.appendFile(
|
|
558
|
+
GITHUB_OUTPUT,
|
|
559
|
+
`urls=${outputMetadata.packages.map((pkg) => pkg.url).join(" ")}\n`,
|
|
560
|
+
"utf8",
|
|
561
|
+
);
|
|
562
|
+
await fs.appendFile(
|
|
563
|
+
GITHUB_OUTPUT,
|
|
564
|
+
`packages=${outputMetadata.packages.map((pkg) => `${pkg.name}@${pkg.url}`).join(" ")}\n`,
|
|
565
|
+
"utf8",
|
|
566
|
+
);
|
|
555
567
|
},
|
|
556
568
|
};
|
|
557
569
|
},
|