1
0
Fork 0
toolkit/packages/core
Jonathan Clem 451bb07ec4
Run npm run lint -- --fix
2019-05-21 10:51:22 -04:00
..
__tests__ Format lib.test.ts 2019-05-21 10:11:39 -04:00
src Run npm run lint -- --fix 2019-05-21 10:51:22 -04:00
README.md spec update 2019-05-17 10:38:16 -04:00
package-lock.json starting on core 2019-05-16 23:36:45 -04:00
package.json Add tests, getInput should be case-insensitive and trim output 2019-05-17 10:31:07 -04:00
tsconfig.json Add Bryan's core code 2019-05-16 16:40:21 -04:00

README.md

@actions/core

Core functions for setting results, logging, registering secrets and exporting variables across actions

Usage

// 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 options   optional. See ExportOptions.
 */
export function exportVariable(name: string, val: string): void

/**
 * exports the variable and registers a secret which will get masked from logs
 * @param name the name of the variable to set
 * @param val value of the secret
 */
export function exportSecret(name: string, val: string) {
    exportVariable(name, val);
    intm._issueCommand('set-secret', {}, val);
} 

/**
 * Interface for getInput options
 */
export interface InputOptions {
    /** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */
    required?: bool;
}

/**
 * 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 getInput(name: string, options?: InputOptions): string | undefined

/**
 * sets the status of the action to neutral
 * @param message 
 */
export function setNeutral(message: string): void

/**
 * sets the status of the action to failed
 * @param message 
 */
export function setFailed(message: string): void