fix state helper

This commit is contained in:
ruki
2025-01-14 22:48:20 +08:00
Unverified
parent 31f247c6c5
commit 086cd7331c
2 changed files with 2 additions and 30 deletions
+2 -2
View File
@@ -39,8 +39,8 @@ async function cleanup(): Promise<void> {
} }
if (!stateHelper.IsPost) { if (!stateHelper.IsPost) {
run().catch((e: Error) => core.error(e)); await run().catch((e: Error) => core.error(e));
} }
else { else {
cleanup().catch((e: Error) => core.error(e)); await cleanup().catch((e: Error) => core.error(e));
} }
-28
View File
@@ -25,34 +25,6 @@ export const SshKeyPath = core.getState('sshKeyPath')
*/ */
export const SshKnownHostsPath = core.getState('sshKnownHostsPath') 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. // 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. // This is necessary since we don't have a separate entry point.
if (!IsPost) { if (!IsPost) {