Skip to content

Commit

Permalink
autobuild: add working-directory input
Browse files Browse the repository at this point in the history
  • Loading branch information
cklin committed Apr 7, 2022
1 parent a0b5962 commit ee9fd38
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [UNRELEASED]

- Update default CodeQL bundle version to 2.8.5. [#1014](https://github.com/github/codeql-action/pull/1014)
- Add `working-directory` input to the `autobuild` action. [#1024](https://github.com/github/codeql-action/pull/1024)

## 2.1.7 - 05 Apr 2022

Expand Down
8 changes: 7 additions & 1 deletion autobuild/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ inputs:
default: ${{ github.token }}
matrix:
default: ${{ toJson(matrix) }}
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
runs:
using: 'node16'
main: '../lib/autobuild-action.js'
main: '../lib/autobuild-action.js'
5 changes: 5 additions & 0 deletions lib/autobuild-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/autobuild-action.js.map

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

8 changes: 8 additions & 0 deletions src/autobuild-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as core from "@actions/core";
import {
createStatusReportBase,
getActionsStatus,
getOptionalInput,
getTemporaryDirectory,
sendStatusReport,
StatusReportBase,
Expand Down Expand Up @@ -71,6 +72,13 @@ async function run() {
}
language = determineAutobuildLanguage(config, logger);
if (language !== undefined) {
const workingDirectory = getOptionalInput("working-directory");
if (workingDirectory) {
logger.info(
`Changing autobuilder working directory to ${workingDirectory}`
);
process.chdir(workingDirectory);
}
await runAutobuild(language, config, logger);
}
} catch (error) {
Expand Down

0 comments on commit ee9fd38

Please sign in to comment.