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/state-helper.ts
diff options
context:
space:
mode:
authoreric sciple <ericsciple@users.noreply.github.com>2020-03-11 15:55:17 -0400
committerGitHub <noreply@github.com>2020-03-11 15:55:17 -0400
commit1b406b27feed694fb3a05a638c92124514baa6ea (patch)
tree05a8d7cd5c1748d2e83782e43edb2c274882ea90 /src/state-helper.ts
parentad8315eb967265115b59c3b9dc1516f8ac5917ba (diff)
add ssh support (#163)
Diffstat (limited to 'src/state-helper.ts')
-rw-r--r--src/state-helper.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/state-helper.ts b/src/state-helper.ts
index da15d86..3c657b1 100644
--- a/src/state-helper.ts
+++ b/src/state-helper.ts
@@ -12,6 +12,17 @@ export const RepositoryPath =
(process.env['STATE_repositoryPath'] as string) || ''
/**
+ * 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) || ''
+
+/**
+ * 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) || ''
+
+/**
* Save the repository path so the POST action can retrieve the value.
*/
export function setRepositoryPath(repositoryPath: string) {
@@ -22,6 +33,24 @@ export function setRepositoryPath(repositoryPath: string) {
)
}
+/**
+ * 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)
+}
+
+/**
+ * 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
+ )
+}
+
// 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) {