feat: default continue mode behaviour

Signed-off-by: Dwi Siswanto <me@dw1.io>
This commit is contained in:
Dwi Siswanto 2023-10-02 22:42:39 +07:00
parent 192819dddf
commit deb5cdee44
No known key found for this signature in database
GPG Key ID: D192CC08161630BD
2 changed files with 10 additions and 1 deletions

View File

@ -202,6 +202,9 @@ The following input actions are supported:
| `DSLIM_HTTP_PROBE_API_SPEC_FILE` | Run HTTP probes for API spec from file |
</details>
> **Note**
> Please note that when you disable HTTP probing (either by setting `DSLIM_HTTP_PROBE_OFF` to `true` or `DSLIM_HTTP_PROBE` to `false`), it will effectively modify the behavior of the continue mode (if the `DSLIM_CONTINUE_AFTER` value is undefined) by imposing a timeout of **1** second. This adjustment occurs because, by default, when HTTP probes are disabled, the Slim's behavior will switch to '**enter**' mode — and there is no way to interact with the temporary container created by Slim within the GitHub Action runner.
## Outputs
To view the report results generated by the Slim build command, you can access the `report` property (`Object`) of the `steps` outputs context. Here's an example of how to access it: `${{ steps.<id>.outputs.report }}`.

View File

@ -126,7 +126,13 @@ async function run() {
core.info(`slim on target: ${inputTarget}`);
await shell.exec('slim', ['b', '--target', inputTarget], {cwd: SLIM_PATH});
let args = ['b', '--target', inputTarget];
if (process.env['DSLIM_HTTP_PROBE_OFF'] == 'true' || process.env['DSLIM_HTTP_PROBE'] == 'false') {
if (typeof process.env['DSLIM_CONTINUE_AFTER'] === 'undefined') args.push('--continue-after', '1')
}
await shell.exec('slim', args, {cwd: SLIM_PATH});
const data = fs.readFileSync(path.join(SLIM_PATH, 'slim.report.json'));
const report = JSON.parse(data);