mirror of
				https://github.com/actions/checkout.git
				synced 2025-10-31 05:25:55 +08:00 
			
		
		
		
	.
This commit is contained in:
		
							
								
								
									
										20
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -498,13 +498,21 @@ class GitAuthHelper { | ||||
|             } | ||||
|             // Remove credentials config files
 | ||||
|             for (const credentialsPath of credentialsPaths) { | ||||
|                 try { | ||||
|                     core.info(`Removing credentials config '${credentialsPath}'`); | ||||
|                     yield io.rmRF(credentialsPath); | ||||
|                 // Only remove credentials config files if they are under RUNNER_TEMP
 | ||||
|                 const runnerTemp = process.env['RUNNER_TEMP']; | ||||
|                 assert.ok(runnerTemp, 'RUNNER_TEMP is not defined'); | ||||
|                 if (credentialsPath.startsWith(runnerTemp)) { | ||||
|                     try { | ||||
|                         core.info(`Removing credentials config '${credentialsPath}'`); | ||||
|                         yield io.rmRF(credentialsPath); | ||||
|                     } | ||||
|                     catch (err) { | ||||
|                         core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`); | ||||
|                         core.warning(`Failed to remove credentials config '${credentialsPath}'`); | ||||
|                     } | ||||
|                 } | ||||
|                 catch (err) { | ||||
|                     core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`); | ||||
|                     core.warning(`Failed to remove credentials config '${credentialsPath}'`); | ||||
|                 else { | ||||
|                     core.debug(`Skipping removal of credentials config '${credentialsPath}' - not under RUNNER_TEMP`); | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user