From fec63479ee5b3e445444fd42497f9c18fd7c9255 Mon Sep 17 00:00:00 2001 From: messense Date: Thu, 26 Oct 2023 08:54:11 +0800 Subject: [PATCH] Allow absolute `working-directory` --- dist/index.js | 4 +++- src/index.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 01bef6e..df69bbd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -11500,7 +11500,9 @@ function getWorkingDirectory() { const workspace = process.env.GITHUB_WORKSPACE; let workdir = core.getInput('working-directory'); if (workdir.length > 0) { - workdir = path.join(workspace, workdir); + if (!path.isAbsolute(workdir)) { + workdir = path.join(workspace, workdir); + } } else { workdir = workspace; diff --git a/src/index.ts b/src/index.ts index 846bcc2..8a124e8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -180,7 +180,9 @@ function getWorkingDirectory(): string { const workspace = process.env.GITHUB_WORKSPACE! let workdir = core.getInput('working-directory') if (workdir.length > 0) { - workdir = path.join(workspace, workdir) + if (!path.isAbsolute(workdir)) { + workdir = path.join(workspace, workdir) + } } else { workdir = workspace }