1
0
Fork 0

Merge branch 'features/core' of https://github.com/actions/toolkit into features/core

pull/4/head
Danny McCormick 2019-05-17 10:31:28 -04:00
commit aa10eecbb0
2 changed files with 27 additions and 41 deletions

View File

@ -42,7 +42,7 @@ export function getInput(name: string, options?: InputOptions): string | undefin
* sets the status of the action to neutral * sets the status of the action to neutral
* @param message * @param message
*/ */
export function setFailed(message: string): void export function setNeutral(message: string): void
/** /**
* sets the status of the action to failed * sets the status of the action to failed

View File

@ -5,60 +5,46 @@
## Usage ## Usage
``` ```
//----------------------------------------------------------------------- // Logging functions
// Variables, Inputs and Outputs export function debug(message: string): void
//----------------------------------------------------------------------- export function warning(message: string): void
export function error(message: string): void
/** /**
* sets env variable for this action and future actions in the job * sets env variable for this action and future actions in the job
*
* @param name the name of the variable to set * @param name the name of the variable to set
* @param val the value of the variable * @param val the value of the variable
* @param options optional. See ExportOptions.
*/ */
export function exportVariable(name: string, val: string); export function exportVariable(name: string, val: string): void
/** /**
* registers a secret which will get masked from logs * Interface for getInput options
* @param val value of the secret
*/ */
export function setSecret(name: string, val: string); export interface InputOptions {
/** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */
// TODO: follow up and see if we need anything for outputs required?: bool;
}
//-----------------------------------------------------------------------
// Results
//-----------------------------------------------------------------------
/** /**
* Sets the action status to neutral * Gets the value of an input. The value is also trimmed.
*
* @param name name of the input to get
* @param options optional. See InputOptions.
* @returns string
*/ */
export function setNeutral(); export function getInput(name: string, options?: InputOptions): string | undefined
/** /**
* Sets the action status to failed. * sets the status of the action to neutral
* When the action exits it will be with an exit code of 1 * @param message
* @param message add error issue message
*/ */
export function setFailed(message: string); export function setNeutral(message: string): void
//-----------------------------------------------------------------------
// Logging Commands
//-----------------------------------------------------------------------
/** /**
* Writes debug message to user log * sets the status of the action to failed
* @param message debug message * @param message
*/ */
export function debug(message: string); export function setFailed(message: string): void
/**
* Adds an error issue
* @param message error issue message
*/
export function error(message: string);
/**
* Adds an warning issue
* @param message warning issue message
*/
export function warning(message: string);
``` ```