mirror of
				https://code.forgejo.org/actions/checkout.git
				synced 2025-11-03 22:29:11 +00:00 
			
		
		
		
	update the correct config
This commit is contained in:
		
							parent
							
								
									72b08f7601
								
							
						
					
					
						commit
						01e894d3c0
					
				
					 2 changed files with 6 additions and 2 deletions
				
			
		
							
								
								
									
										4
									
								
								dist/index.js
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/index.js
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -5631,7 +5631,9 @@ function configureAuthToken(git, authToken, global) {
 | 
			
		|||
        const basicCredential = Buffer.from(`x-access-token:${authToken}`, 'utf8').toString('base64');
 | 
			
		||||
        core.setSecret(basicCredential);
 | 
			
		||||
        // Replace the value in the config file
 | 
			
		||||
        const configPath = path.join(git.getWorkingDirectory(), '.git', 'config');
 | 
			
		||||
        const configPath = global
 | 
			
		||||
            ? path.join(process.env.HOME, '.gitconfig')
 | 
			
		||||
            : path.join(git.getWorkingDirectory(), '.git', 'config');
 | 
			
		||||
        let content = (yield fs.promises.readFile(configPath)).toString();
 | 
			
		||||
        const placeholderIndex = content.indexOf(placeholder);
 | 
			
		||||
        if (placeholderIndex < 0 ||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue