1
0
Fork 0
mirror of https://github.com/actions/toolkit synced 2025-05-09 08:33:00 +00:00

setSecret (#174)

* setSecret
This commit is contained in:
Bryan MacFarlane 2019-10-01 17:13:05 -04:00 committed by GitHub
parent 713902387e
commit 9d54cd22ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 47 deletions

View file

@ -31,7 +31,7 @@ export enum ExitCode {
//-----------------------------------------------------------------------
/**
* 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 val the value of the variable
*/
@ -41,16 +41,11 @@ 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
* Registers a secret which will get masked from logs
* @param secret value of the secret
*/
export function exportSecret(name: string, val: string): void {
exportVariable(name, val)
// the runner will error with not implemented
// leaving the function but raising the error earlier
issueCommand('set-secret', {}, val)
export function setSecret(secret: string): void {
issueCommand('add-mask', {}, secret)
}
/**