diff --git a/packages/core/RELEASES.md b/packages/core/RELEASES.md index 352efe84..4926ebdc 100644 --- a/packages/core/RELEASES.md +++ b/packages/core/RELEASES.md @@ -1,5 +1,8 @@ # @actions/core Releases +### 1.2.7 +- [Prepend newline for set-output](https://github.com/actions/toolkit/pull/772) + ### 1.2.6 - [Update `exportVariable` and `addPath` to use environment files](https://github.com/actions/toolkit/pull/571) diff --git a/packages/core/__tests__/core.test.ts b/packages/core/__tests__/core.test.ts index 0e52e9b2..a069e89c 100644 --- a/packages/core/__tests__/core.test.ts +++ b/packages/core/__tests__/core.test.ts @@ -159,17 +159,20 @@ describe('@actions/core', () => { it('setOutput produces the correct command', () => { core.setOutput('some output', 'some value') - assertWriteCalls([`::set-output name=some output::some value${os.EOL}`]) + assertWriteCalls([ + os.EOL, + `::set-output name=some output::some value${os.EOL}` + ]) }) it('setOutput handles bools', () => { core.setOutput('some output', false) - assertWriteCalls([`::set-output name=some output::false${os.EOL}`]) + assertWriteCalls([os.EOL, `::set-output name=some output::false${os.EOL}`]) }) it('setOutput handles numbers', () => { core.setOutput('some output', 1.01) - assertWriteCalls([`::set-output name=some output::1.01${os.EOL}`]) + assertWriteCalls([os.EOL, `::set-output name=some output::1.01${os.EOL}`]) }) it('setFailed sets the correct exit code and failure message', () => { diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json index a1ede3d2..e2625929 100644 --- a/packages/core/package-lock.json +++ b/packages/core/package-lock.json @@ -1,6 +1,6 @@ { "name": "@actions/core", - "version": "1.2.6", + "version": "1.2.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/core/package.json b/packages/core/package.json index ffcced43..a0e72b31 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@actions/core", - "version": "1.2.6", + "version": "1.2.7", "description": "Actions core lib", "keywords": [ "github", diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index e7e366c5..13f4dfa3 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -99,6 +99,7 @@ export function getInput(name: string, options?: InputOptions): string { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any export function setOutput(name: string, value: any): void { + process.stdout.write(os.EOL) issueCommand('set-output', {name}, value) }