diff --git a/lib/entry-points.js b/lib/entry-points.js index 123382751..ed83519d0 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -146401,8 +146401,8 @@ var persistInputs = function(env = getEnv()) { var restoreInputs = function() { try { const persistedInputsValue = core3.getState(persistedInputsKey); - const persistedInputs = JSON.parse(persistedInputsValue); - if (persistedInputs) { + if (persistedInputsValue) { + const persistedInputs = JSON.parse(persistedInputsValue); for (const [name, value] of persistedInputs) { process.env[name] = value; } diff --git a/src/actions-util.ts b/src/actions-util.ts index df682d4eb..dd11f7aa0 100644 --- a/src/actions-util.ts +++ b/src/actions-util.ts @@ -416,9 +416,9 @@ export const persistInputs = function (env: Env = getEnv()) { export const restoreInputs = function () { try { const persistedInputsValue = core.getState(persistedInputsKey); - const persistedInputs = JSON.parse(persistedInputsValue); + if (persistedInputsValue) { + const persistedInputs = JSON.parse(persistedInputsValue); - if (persistedInputs) { for (const [name, value] of persistedInputs) { process.env[name] = value; }