with-post-step: fix linter issues

This commit is contained in:
umarcor
2021-11-30 02:52:15 +01:00
parent 7d48fcd589
commit a9a49a78fa

View File

@@ -21,12 +21,12 @@
// * https://github.com/docker/login-action/issues/72 // * https://github.com/docker/login-action/issues/72
// * https://github.com/actions/runner/issues/1478 // * https://github.com/actions/runner/issues/1478
const { exec } = require('child_process'); const { exec } = require("child_process");
function run(cmd) { function run(cmd) {
exec(cmd, (error, stdout, stderr) => { exec(cmd, (error, stdout, stderr) => {
if ( stdout.length != 0 ) { console.log(`${stdout}`); } if ( stdout.length !== 0 ) { console.log(`${stdout}`); }
if ( stderr.length != 0 ) { console.error(`${stderr}`); } if ( stderr.length !== 0 ) { console.error(`${stderr}`); }
if (error) { if (error) {
process.exitCode = error.code; process.exitCode = error.code;
console.error(`${error}`); console.error(`${error}`);
@@ -36,7 +36,7 @@ function run(cmd) {
const key = process.env.INPUT_KEY.toUpperCase(); const key = process.env.INPUT_KEY.toUpperCase();
if ( process.env[`STATE_${key}`] != undefined ) { // Are we in the 'post' step? if ( process.env[`STATE_${key}`] !== undefined ) { // Are we in the 'post' step?
run(process.env.INPUT_POST); run(process.env.INPUT_POST);
} else { // Otherwise, this is the main step } else { // Otherwise, this is the main step
console.log(`::save-state name=${key}::true`); console.log(`::save-state name=${key}::true`);