diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index 179424a362..bd98e4b598 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -1,8 +1,5 @@ import {issue, issueCommand} from './command' -import { - issueCommand as issueFileCommand, - prepareKeyValueMessage as prepareCommandValue -} from './file-command' +import {issueFileCommand, prepareKeyValueMessage} from './file-command' import {toCommandProperties, toCommandValue} from './utils' import * as os from 'os' @@ -89,7 +86,7 @@ export function exportVariable(name: string, val: any): void { const filePath = process.env['GITHUB_ENV'] || '' if (filePath) { - return issueFileCommand('ENV', prepareCommandValue(name, val)) + return issueFileCommand('ENV', prepareKeyValueMessage(name, val)) } issueCommand('set-env', {name}, convertedVal) @@ -195,7 +192,7 @@ export function getBooleanInput(name: string, options?: InputOptions): boolean { export function setOutput(name: string, value: any): void { const filePath = process.env['GITHUB_OUTPUT'] || '' if (filePath) { - return issueFileCommand('OUTPUT', prepareCommandValue(name, value)) + return issueFileCommand('OUTPUT', prepareKeyValueMessage(name, value)) } process.stdout.write(os.EOL) @@ -355,7 +352,7 @@ export async function group(name: string, fn: () => Promise): Promise { export function saveState(name: string, value: any): void { const filePath = process.env['GITHUB_STATE'] || '' if (filePath) { - return issueFileCommand('STATE', prepareCommandValue(name, value)) + return issueFileCommand('STATE', prepareKeyValueMessage(name, value)) } issueCommand('save-state', {name}, toCommandValue(value)) diff --git a/packages/core/src/file-command.ts b/packages/core/src/file-command.ts index 283770e648..832c2f0e61 100644 --- a/packages/core/src/file-command.ts +++ b/packages/core/src/file-command.ts @@ -8,7 +8,7 @@ import * as os from 'os' import {v4 as uuidv4} from 'uuid' import {toCommandValue} from './utils' -export function issueCommand(command: string, message: any): void { +export function issueFileCommand(command: string, message: any): void { const filePath = process.env[`GITHUB_${command}`] if (!filePath) { throw new Error(