Move the action from Deno to Node.js and Vite+
This commit is contained in:
+9
-6
@@ -1,8 +1,13 @@
|
||||
import { appendFile, rm } from "node:fs/promises";
|
||||
import process from "node:process";
|
||||
|
||||
import { prepareRuntime } from "./runtime.ts";
|
||||
|
||||
const env = (name: string): string => {
|
||||
const value = Deno.env.get(name);
|
||||
if (!value) throw new Error(`${name} is not set`);
|
||||
const value = process.env[name];
|
||||
if (value === undefined || value === "") {
|
||||
throw new Error(`${name} is not set`);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
@@ -12,10 +17,8 @@ const manifest = await prepareRuntime(
|
||||
env("BOT_AGENTS_MASTER_KEY"),
|
||||
);
|
||||
try {
|
||||
await Deno.writeTextFile(env("GITHUB_OUTPUT"), `manifest=${manifest.manifestPath}\n`, {
|
||||
append: true,
|
||||
});
|
||||
await appendFile(env("GITHUB_OUTPUT"), `manifest=${manifest.manifestPath}\n`);
|
||||
} catch (error) {
|
||||
await Deno.remove(manifest.runtimeDir, { recursive: true }).catch(() => undefined);
|
||||
await rm(manifest.runtimeDir, { recursive: true }).catch(() => {});
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user