From 086cd7331cfa9c1afc54aae7ea46599ae6d2bc3f Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 14 Jan 2025 22:48:20 +0800 Subject: [PATCH] fix state helper --- src/index.ts | 4 ++-- src/state-helper.ts | 28 ---------------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/src/index.ts b/src/index.ts index ac31877..25d910f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -39,8 +39,8 @@ async function cleanup(): Promise { } if (!stateHelper.IsPost) { - run().catch((e: Error) => core.error(e)); + await run().catch((e: Error) => core.error(e)); } else { - cleanup().catch((e: Error) => core.error(e)); + await cleanup().catch((e: Error) => core.error(e)); } diff --git a/src/state-helper.ts b/src/state-helper.ts index aa3eecc..dd26921 100644 --- a/src/state-helper.ts +++ b/src/state-helper.ts @@ -25,34 +25,6 @@ export const SshKeyPath = core.getState('sshKeyPath') */ export const SshKnownHostsPath = core.getState('sshKnownHostsPath') -/** - * Save the repository path so the POST action can retrieve the value. - */ -export function setRepositoryPath(repositoryPath: string) { - core.saveState('repositoryPath', repositoryPath) -} - -/** - * Save the SSH key path so the POST action can retrieve the value. - */ -export function setSshKeyPath(sshKeyPath: string) { - core.saveState('sshKeyPath', sshKeyPath) -} - -/** - * Save the SSH known hosts path so the POST action can retrieve the value. - */ -export function setSshKnownHostsPath(sshKnownHostsPath: string) { - core.saveState('sshKnownHostsPath', sshKnownHostsPath) -} - -/** - * Save the set-safe-directory input so the POST action can retrieve the value. - */ -export function setSafeDirectory() { - core.saveState('setSafeDirectory', 'true') -} - // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic. // This is necessary since we don't have a separate entry point. if (!IsPost) {