Skip to content

Commit

Permalink
Use get workspace path
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoalh committed Sep 8, 2024
1 parent 4d38898 commit 0ff1620
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions _payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
type JSONObject,
type JSONValue,
} from "ISJSON";
import { getRunnerWorkspacePath } from "GHACTIONS/runner";
import getRegExpURL from "REGEXPURL";
import { contentType } from "STD/media-types/content-type";
import { basename as pathBasename } from "STD/path/basename";
Expand Down Expand Up @@ -367,13 +368,7 @@ async function resolveFilesFormData(files: string[]): Promise<FormData> {
return formData;
}
export async function resolveFiles(files: string[], glob: boolean): Promise<FormData | undefined> {
const workspace: string | undefined = Deno.env.get("GITHUB_WORKSPACE");
if (typeof workspace === "undefined") {
throw new Error(`Environment variable \`GITHUB_WORKSPACE\` is not defined!`);
}
if (!pathIsAbsolute(workspace)) {
throw new Error(`\`${workspace}\` is not an absolute path for workspace!`);
}
const workspace: string = getRunnerWorkspacePath();
const workspaceStat: Deno.FileInfo = await Deno.stat(workspace);
if (!workspaceStat.isDirectory) {
throw new Deno.errors.NotADirectory(`Workspace \`${workspace}\` is not a directory!`);
Expand Down

0 comments on commit 0ff1620

Please sign in to comment.