mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 11:06:56 +08:00
with-post-step: fix linter issues
This commit is contained in:
@@ -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`);
|
||||||
|
|||||||
Reference in New Issue
Block a user