Skip to content

Commit

Permalink
feat: add default value for jikkou_config input
Browse files Browse the repository at this point in the history
  • Loading branch information
fhussonnois committed Oct 1, 2023
1 parent d8ac550 commit 03d412a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
1 change: 0 additions & 1 deletion .github/workflows/setup-jikkou-wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
uses: ./
with:
jikkou_version: ${{ matrix['jikkou-versions'] }}
jikkou_config: ./config/jikkouconfig.json
jikkou_wrapper: true

- name: Validate Jikkou Version - ${{ matrix['jikkou-versions'] }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/setup-jikkou.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
uses: ./
with:
jikkou_version: ${{ matrix['jikkou-versions'] }}
jikkou_config: ./config/jikkouconfig.json
jikkou_wrapper: false

- name: Validate Jikkou Version - ${{ matrix['jikkou-versions'] }}
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ inputs:
default: 'latest'
required: false
jikkou_config:
description: 'The path to the Jikkou CLI config file. If set, Jikkou CLI will be configured through the `JIKKOUCONFIG` environment variable.'
description: 'The path to the Jikkou CLI config file. If set and file exist, Jikkou CLI will be configured through the `JIKKOUCONFIG` environment variable (Default: `/.jikkou/config.json`).'
default: "./.jikkou/config.json"
required: false
jikkou_wrapper:
description: 'Whether or not to install a wrapper to wrap calls of the `jikkou` binary to expose its STDOUT, STDERR, and exit code as outputs named `stdout`, `stderr`, and `exitcode` respectively. Defaults to `true`.'
Expand Down
13 changes: 9 additions & 4 deletions lib/setup-jikkou.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,15 @@ async function run() {
),
);

if (inputConfig) {
const pathToConfigFile = path.resolve(inputConfig);
core.info(`Set environment variable JIKKOUCONFIG=${pathToConfigFile}`);
core.exportVariable("JIKKOUCONFIG", pathToConfigFile);
// Configure Jikkou Config File
if (inputConfig && inputConfig !== '') {
const pathToConfigFile = path.resolve(inputConfig);
if (fs.existsSync(pathToConfigFile)) {
core.info(`Set environment variable JIKKOUCONFIG=${pathToConfigFile}`);
core.exportVariable("JIKKOUCONFIG", pathToConfigFile)
} else {
core.warn(`Jikkou config file does not exist: "${pathToConfigFile}"`);
}
}

// Install Wrapper
Expand Down

0 comments on commit 03d412a

Please sign in to comment.