Add docs and wrapper for "echo" command (#411)
* Add docs and wrapper for "echo" command * Update parameter to enabled
This commit is contained in:
1 parent
a027ac4171
commit
6b8a8e58a9
2 files changed
+19
No files matched your search
@@ -239,6 +239,16 @@ describe('@actions/core', () => {
|
|||||||
process.env['RUNNER_DEBUG'] = current
|
process.env['RUNNER_DEBUG'] = current
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('setCommandEcho can enable echoing', () => {
|
||||||
|
core.setCommandEcho(true)
|
||||||
|
assertWriteCalls([`::echo::on${os.EOL}`])
|
||||||
|
})
|
||||||
|
|
||||||
|
it('setCommandEcho can disable echoing', () => {
|
||||||
|
core.setCommandEcho(false)
|
||||||
|
assertWriteCalls([`::echo::off${os.EOL}`])
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// Assert that process.stdout.write calls called only with the given arguments.
|
// Assert that process.stdout.write calls called only with the given arguments.
|
||||||
|
|||||||
@@ -87,6 +87,15 @@ export function setOutput(name: string, value: any): void {
|
|||||||
issueCommand('set-output', {name}, value)
|
issueCommand('set-output', {name}, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables or disables the echoing of commands into stdout for the rest of the step.
|
||||||
|
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export function setCommandEcho(enabled: boolean): void {
|
||||||
|
issue('echo', enabled ? 'on' : 'off')
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Results
|
// Results
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
|
|||||||
Reference in new issue
Block a user