Skip to content

Commit 9579083

Browse files
committed
Address review comments
1 parent 66d1096 commit 9579083

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

packages/core/src/core.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import {issue, issueCommand} from './command'
2-
import {
3-
issueCommand as issueFileCommand,
4-
prepareKeyValueMessage as prepareCommandValue
5-
} from './file-command'
2+
import {issueFileCommand, prepareKeyValueMessage} from './file-command'
63
import {toCommandProperties, toCommandValue} from './utils'
74

85
import * as os from 'os'
@@ -89,7 +86,7 @@ export function exportVariable(name: string, val: any): void {
8986

9087
const filePath = process.env['GITHUB_ENV'] || ''
9188
if (filePath) {
92-
return issueFileCommand('ENV', prepareCommandValue(name, val))
89+
return issueFileCommand('ENV', prepareKeyValueMessage(name, val))
9390
}
9491

9592
issueCommand('set-env', {name}, convertedVal)
@@ -191,7 +188,7 @@ export function getBooleanInput(name: string, options?: InputOptions): boolean {
191188
export function setOutput(name: string, value: any): void {
192189
const filePath = process.env['GITHUB_OUTPUT'] || ''
193190
if (filePath) {
194-
return issueFileCommand('OUTPUT', prepareCommandValue(name, value))
191+
return issueFileCommand('OUTPUT', prepareKeyValueMessage(name, value))
195192
}
196193

197194
process.stdout.write(os.EOL)
@@ -351,7 +348,7 @@ export async function group<T>(name: string, fn: () => Promise<T>): Promise<T> {
351348
export function saveState(name: string, value: any): void {
352349
const filePath = process.env['GITHUB_STATE'] || ''
353350
if (filePath) {
354-
return issueFileCommand('STATE', prepareCommandValue(name, value))
351+
return issueFileCommand('STATE', prepareKeyValueMessage(name, value))
355352
}
356353

357354
issueCommand('save-state', {name}, toCommandValue(value))

packages/core/src/file-command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as os from 'os'
88
import {v4 as uuidv4} from 'uuid'
99
import {toCommandValue} from './utils'
1010

11-
export function issueCommand(command: string, message: any): void {
11+
export function issueFileCommand(command: string, message: any): void {
1212
const filePath = process.env[`GITHUB_${command}`]
1313
if (!filePath) {
1414
throw new Error(

0 commit comments

Comments
 (0)