mirror of
				https://code.forgejo.org/actions/checkout.git
				synced 2025-11-03 22:29:11 +00:00 
			
		
		
		
	Implement allow-path-outside-workspace
This commit is contained in:
		
							parent
							
								
									cbb722410c
								
							
						
					
					
						commit
						d1d381abe7
					
				
					 4 changed files with 11 additions and 1 deletions
				
			
		
							
								
								
									
										3
									
								
								dist/index.js
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								dist/index.js
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -1737,7 +1737,8 @@ function getInputs() {
 | 
			
		|||
        // Repository path
 | 
			
		||||
        result.repositoryPath = core.getInput('path') || '.';
 | 
			
		||||
        result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
 | 
			
		||||
        if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
 | 
			
		||||
        if (!core.getInput('allow-path-outside-workspace') &&
 | 
			
		||||
            !(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
 | 
			
		||||
            throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
 | 
			
		||||
        }
 | 
			
		||||
        // Workflow repository?
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue