mirror of
				https://github.com/actions/checkout.git
				synced 2025-11-01 03:53:26 +08:00 
			
		
		
		
	Add set-safe-directory input to allow customers to take control. (#770)
* Add set-safe-directory input to allow customers to take control.
This commit is contained in:
		| @@ -11,6 +11,12 @@ export const IsPost = !!process.env['STATE_isPost'] | ||||
| 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. | ||||
|  */ | ||||
| @@ -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) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Tingluo Huang
					Tingluo Huang