From b25c8772ede48419c1389417269746e91ef15dc5 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Tue, 21 May 2019 14:40:57 -0400 Subject: [PATCH] set-env instead of set-variable --- packages/core/__tests__/lib.test.ts | 12 ++++++------ packages/core/src/core.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/core/__tests__/lib.test.ts b/packages/core/__tests__/lib.test.ts index c15132bd..a21b51e1 100644 --- a/packages/core/__tests__/lib.test.ts +++ b/packages/core/__tests__/lib.test.ts @@ -29,28 +29,28 @@ describe('@actions/core', () => { it('exportVariable produces the correct command and sets the env', () => { core.exportVariable('my var', 'var val') - assertWriteCalls([`##[set-variable name=my var;]var val${os.EOL}`]) + assertWriteCalls([`##[set-env name=my var;]var val${os.EOL}`]) }) it('exportVariable escapes variable names', () => { core.exportVariable('special char var \r\n];', 'special val') expect(process.env['special char var \r\n];']).toBe('special val') assertWriteCalls([ - `##[set-variable name=special char var %0D%0A%5D%3B;]special val${os.EOL}` + `##[set-env name=special char var %0D%0A%5D%3B;]special val${os.EOL}` ]) }) it('exportVariable escapes variable values', () => { core.exportVariable('my var2', 'var val\r\n') expect(process.env['my var2']).toBe('var val\r\n') - assertWriteCalls([`##[set-variable name=my var2;]var val%0D%0A${os.EOL}`]) + assertWriteCalls([`##[set-env name=my var2;]var val%0D%0A${os.EOL}`]) }) it('exportSecret produces the correct commands and sets the env', () => { core.exportSecret('my secret', 'secret val') expect(process.env['my secret']).toBe('secret val') assertWriteCalls([ - `##[set-variable name=my secret;]secret val${os.EOL}`, + `##[set-env name=my secret;]secret val${os.EOL}`, `##[set-secret]secret val${os.EOL}` ]) }) @@ -59,7 +59,7 @@ describe('@actions/core', () => { core.exportSecret('special char secret \r\n];', 'special secret val') expect(process.env['special char secret \r\n];']).toBe('special secret val') assertWriteCalls([ - `##[set-variable name=special char secret %0D%0A%5D%3B;]special secret val${ + `##[set-env name=special char secret %0D%0A%5D%3B;]special secret val${ os.EOL }`, `##[set-secret]special secret val${os.EOL}` @@ -70,7 +70,7 @@ describe('@actions/core', () => { core.exportSecret('my secret2', 'secret val\r\n') expect(process.env['my secret2']).toBe('secret val\r\n') assertWriteCalls([ - `##[set-variable name=my secret2;]secret val%0D%0A${os.EOL}`, + `##[set-env name=my secret2;]secret val%0D%0A${os.EOL}`, `##[set-secret]secret val%0D%0A${os.EOL}` ]) }) diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index 6e6c548c..9fb0d782 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -20,7 +20,7 @@ export interface InputOptions { */ export function exportVariable(name: string, val: string) { process.env[name] = val - intm.issueCommand('set-variable', {name}, val) + intm.issueCommand('set-env', {name}, val) } /**