Skip to content

Commit fcaeb81

Browse files
committed
Read out workspace path directly in action
1 parent 178cfa5 commit fcaeb81

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

dist/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122716,15 +122716,15 @@ const cli_1 = __nccwpck_require__(56733);
122716122716
const options = __importStar(__nccwpck_require__(26159));
122717122717
const process = __importStar(__nccwpck_require__(77282));
122718122718
const telemetry_1 = __nccwpck_require__(12417);
122719-
const workingDirectory = options.getWorkingDirectory();
122720-
const currentWorkingDirectory = process.cwd();
122721-
if (workingDirectory !== null && workingDirectory.length > 0) {
122722-
process.chdir(workingDirectory);
122723-
}
122724122719
(0, telemetry_1.withTelemetry)({
122725122720
enabled: (0, telemetry_1.isTelemetryEnabled)(),
122726122721
}, () => __awaiter(void 0, void 0, void 0, function* () {
122727122722
try {
122723+
const workingDirectory = options.getWorkingDirectory();
122724+
const currentWorkingDirectory = process.cwd();
122725+
if (workingDirectory !== null && workingDirectory.length > 0) {
122726+
process.chdir(workingDirectory);
122727+
}
122728122728
// Validate options first so we can fail early.
122729122729
options.checkEnvironmentVariables();
122730122730
const environment = options.getEnvironment();
@@ -123027,7 +123027,7 @@ const getUrlPrefixOption = () => {
123027123027
};
123028123028
exports.getUrlPrefixOption = getUrlPrefixOption;
123029123029
const getWorkingDirectory = () => {
123030-
return core.getInput('working_directory');
123030+
return core.getInput('working_directory') || process.env.GITHUB_WORKSPACE || '';
123031123031
};
123032123032
exports.getWorkingDirectory = getWorkingDirectory;
123033123033

src/main.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ import {
99
withTelemetry,
1010
} from './telemetry';
1111

12-
const workingDirectory = options.getWorkingDirectory();
13-
const currentWorkingDirectory = process.cwd();
14-
15-
if (workingDirectory !== null && workingDirectory.length > 0) {
16-
process.chdir(workingDirectory);
17-
}
18-
1912
withTelemetry(
2013
{
2114
enabled: isTelemetryEnabled(),
2215
},
2316
async () => {
2417
try {
18+
const workingDirectory = options.getWorkingDirectory();
19+
const currentWorkingDirectory = process.cwd();
20+
21+
if (workingDirectory !== null && workingDirectory.length > 0) {
22+
process.chdir(workingDirectory);
23+
}
24+
2525
// Validate options first so we can fail early.
2626
options.checkEnvironmentVariables();
2727

src/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,5 @@ export const getUrlPrefixOption = (): string => {
193193
};
194194

195195
export const getWorkingDirectory = (): string => {
196-
return core.getInput('working_directory');
196+
return core.getInput('working_directory') || process.env.GITHUB_WORKSPACE || '';
197197
};

0 commit comments

Comments
 (0)