Read-only mirror — the public repositories of the Forgejo instance, refreshed every 10 minutes. The live instance (fg.dieschoenewolke.de) is reachable only over the VPN; clone here with https://git.dieschoenewolke.de/git/<owner>/<repo>.git.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrancesco Renzi <rentziass@github.com>2022-10-13 16:49:13 +0100
committerGitHub <noreply@github.com>2022-10-13 16:49:13 +0100
commit19662885e543e27ce353cce037aad6105e7b29a0 (patch)
tree1152fd12617fb319473e0470f398a080757c5ba3 /src
parent5b71a08291d9715bb1584dd1701d0c6bb35cf890 (diff)
Update @actions/core to 1.10.0 (#962)
* Update @actions/core to 1.10.0 * Backport state-helper updates
Diffstat (limited to 'src')
-rw-r--r--src/state-helper.ts33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/state-helper.ts b/src/state-helper.ts
index 2db79f9..fab9b60 100644
--- a/src/state-helper.ts
+++ b/src/state-helper.ts
@@ -1,71 +1,60 @@
-import * as coreCommand from '@actions/core/lib/command'
+import * as core from '@actions/core'
/**
* Indicates whether the POST action is running
*/
-export const IsPost = !!process.env['STATE_isPost']
+export const IsPost = !!core.getState('isPost')
/**
* The repository path for the POST action. The value is empty during the MAIN action.
*/
-export const RepositoryPath =
- (process.env['STATE_repositoryPath'] as string) || ''
+export const RepositoryPath = core.getState('repositoryPath')
/**
* The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
*/
-export const PostSetSafeDirectory =
- (process.env['STATE_setSafeDirectory'] as string) === 'true'
+export const PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true'
/**
* The SSH key path for the POST action. The value is empty during the MAIN action.
*/
-export const SshKeyPath = (process.env['STATE_sshKeyPath'] as string) || ''
+export const SshKeyPath = core.getState('sshKeyPath')
/**
* The SSH known hosts path for the POST action. The value is empty during the MAIN action.
*/
-export const SshKnownHostsPath =
- (process.env['STATE_sshKnownHostsPath'] as string) || ''
+export const SshKnownHostsPath = core.getState('sshKnownHostsPath')
/**
* Save the repository path so the POST action can retrieve the value.
*/
export function setRepositoryPath(repositoryPath: string) {
- coreCommand.issueCommand(
- 'save-state',
- {name: 'repositoryPath'},
- repositoryPath
- )
+ core.saveState('repositoryPath', repositoryPath)
}
/**
* Save the SSH key path so the POST action can retrieve the value.
*/
export function setSshKeyPath(sshKeyPath: string) {
- coreCommand.issueCommand('save-state', {name: 'sshKeyPath'}, sshKeyPath)
+ core.saveState('sshKeyPath', sshKeyPath)
}
/**
* Save the SSH known hosts path so the POST action can retrieve the value.
*/
export function setSshKnownHostsPath(sshKnownHostsPath: string) {
- coreCommand.issueCommand(
- 'save-state',
- {name: 'sshKnownHostsPath'},
- sshKnownHostsPath
- )
+ core.saveState('sshKnownHostsPath', sshKnownHostsPath)
}
/**
* Save the sef-safe-directory input so the POST action can retrieve the value.
*/
export function setSafeDirectory() {
- coreCommand.issueCommand('save-state', {name: 'setSafeDirectory'}, 'true')
+ 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) {
- coreCommand.issueCommand('save-state', {name: 'isPost'}, 'true')
+ core.saveState('isPost', 'true')
}