fix state helper
This commit is contained in:
+2
-2
@@ -39,8 +39,8 @@ async function cleanup(): Promise<void> {
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user