diff options
| author | Tingluo Huang <tingluohuang@github.com> | 2022-04-20 21:37:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-20 21:37:43 -0400 |
| commit | 5b226525b332718d26fabcfbd1830cdc32336398 (patch) | |
| tree | a5936cc11c9fae7a9826aca6d252f2ec4797409d /src/state-helper.ts | |
| parent | 84aef4aeee750b818c5298364848f4ba472c6f41 (diff) | |
Add set-safe-directory input to allow customers to take control. (#770)
* Add set-safe-directory input to allow customers to take control.
Diffstat (limited to 'src/state-helper.ts')
| -rw-r--r-- | src/state-helper.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/state-helper.ts b/src/state-helper.ts index 3c657b1..2db79f9 100644 --- a/src/state-helper.ts +++ b/src/state-helper.ts @@ -12,6 +12,12 @@ export const RepositoryPath = (process.env['STATE_repositoryPath'] as string) || '' /** + * 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' + +/** * 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) || '' @@ -51,6 +57,13 @@ export function setSshKnownHostsPath(sshKnownHostsPath: string) { ) } +/** + * Save the sef-safe-directory input so the POST action can retrieve the value. + */ +export function setSafeDirectory() { + coreCommand.issueCommand('save-state', {name: '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) { |
