From 792122be542f295d3fe0c6bd6b413e60e07831ae Mon Sep 17 00:00:00 2001 From: Bryan MacFarlane Date: Fri, 17 May 2019 10:29:35 -0400 Subject: [PATCH] update specs --- docs/package-specs.md | 2 +- packages/core/README.md | 66 ++++++++++++++++------------------------- 2 files changed, 27 insertions(+), 41 deletions(-) diff --git a/docs/package-specs.md b/docs/package-specs.md index 115df9e2..f8c9e4e0 100644 --- a/docs/package-specs.md +++ b/docs/package-specs.md @@ -42,7 +42,7 @@ export function getInput(name: string, options?: InputOptions): string | undefin * sets the status of the action to neutral * @param message */ -export function setFailed(message: string): void +export function setNeutral(message: string): void /** * sets the status of the action to failed diff --git a/packages/core/README.md b/packages/core/README.md index 8baaab5f..a4fa04d8 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -5,60 +5,46 @@ ## Usage ``` -//----------------------------------------------------------------------- -// Variables, Inputs and Outputs -//----------------------------------------------------------------------- +// Logging functions +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 - * @param name the name of the variable to set - * @param val the value of the variable + * + * @param name the name of the variable to set + * @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 - * @param val value of the secret + * Interface for getInput options */ -export function setSecret(name: string, val: string); - -// TODO: follow up and see if we need anything for outputs - -//----------------------------------------------------------------------- -// Results -//----------------------------------------------------------------------- +export interface InputOptions { + /** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */ + required?: bool; +} /** - * 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. - * When the action exits it will be with an exit code of 1 - * @param message add error issue message + * sets the status of the action to neutral + * @param message */ -export function setFailed(message: string); - -//----------------------------------------------------------------------- -// Logging Commands -//----------------------------------------------------------------------- +export function setNeutral(message: string): void /** - * Writes debug message to user log - * @param message debug message + * sets the status of the action to failed + * @param message */ -export function debug(message: string); - -/** - * 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); +export function setFailed(message: string): void ```