From f4951ec52e3f33116a12e6ccbaefeb76d5937fd6 Mon Sep 17 00:00:00 2001 From: Antoine Cotten Date: Fri, 27 Jan 2023 18:39:37 +0100 Subject: [PATCH] fix: append EOL after value in GITHUB_STATE --- with-post-step/main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/with-post-step/main.js b/with-post-step/main.js index 1a9c3f0..04c2a9d 100644 --- a/with-post-step/main.js +++ b/with-post-step/main.js @@ -26,7 +26,8 @@ * * https://github.com/actions/runner/issues/1478 * * ================================================================================================================== */ const { spawn } = require("child_process"); -const fs = require('fs'); +const { appendFileSync } = require("fs"); +const { EOL } = require("os"); function run(cmd) { const subprocess = spawn(cmd, { stdio: "inherit", shell: true }); @@ -40,6 +41,6 @@ const key = process.env.INPUT_KEY.toUpperCase(); if ( process.env[`STATE_${key}`] !== undefined ) { // Are we in the 'post' step? run(process.env.INPUT_POST); } else { // Otherwise, this is the main step - fs.appendFileSync(process.env.GITHUB_STATE, `${key}=true`); + appendFileSync(process.env.GITHUB_STATE, `${key}=true${EOL}`); run(process.env.INPUT_MAIN); }