Skip to content

Commit

Permalink
Add working-directory input
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael B. Gale committed Jun 13, 2023
1 parent 4518431 commit 527ea94
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/resolve-environment-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/resolve-environment-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions resolve-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ inputs:
language:
description: The language to infer the build environment configuration for.
required: true
working-directory:
description: >-
Run the autobuilder using this path (relative to $GITHUB_WORKSPACE) as
working directory. If this input is not set, the autobuilder runs with
$GITHUB_WORKSPACE as its working directory.
required: false
outputs:
environment:
description: The inferred build environment configuration.
Expand Down
9 changes: 9 additions & 0 deletions src/resolve-environment-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as core from "@actions/core";

import {
createStatusReportBase,
getOptionalInput,
getRequiredInput,
getTemporaryDirectory,
sendStatusReport,
Expand Down Expand Up @@ -47,6 +48,14 @@ async function run() {
);
}

const workingDirectory = getOptionalInput("working-directory");
if (workingDirectory) {
logger.info(
`Changing autobuilder working directory to ${workingDirectory}`
);
process.chdir(workingDirectory);
}

const result = await runResolveBuildEnvironment(config.codeQLCmd, logger, language);
core.setOutput("environment", result);
} catch (unwrappedError) {
Expand Down

0 comments on commit 527ea94

Please sign in to comment.