mirror of
				https://code.forgejo.org/actions/checkout.git
				synced 2025-11-04 06:39:11 +00:00 
			
		
		
		
	Merge d1d381abe7 into ff7abcd0c3
				
					
				
			This commit is contained in:
		
						commit
						94808f1308
					
				
					 4 changed files with 11 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -100,6 +100,10 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
 | 
			
		|||
    # Relative path under $GITHUB_WORKSPACE to place the repository
 | 
			
		||||
    path: ''
 | 
			
		||||
 | 
			
		||||
    # Allow the checked-out repository to be placed outside of the workspace
 | 
			
		||||
    # Default: false
 | 
			
		||||
    allow-path-outside-workspace: ''
 | 
			
		||||
 | 
			
		||||
    # Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching
 | 
			
		||||
    # Default: true
 | 
			
		||||
    clean: ''
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -54,6 +54,10 @@ inputs:
 | 
			
		|||
    default: true
 | 
			
		||||
  path:
 | 
			
		||||
    description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
 | 
			
		||||
  allow-path-outside-workspace:
 | 
			
		||||
    description: Allow the checked-out repository to be placed outside of the workspace.
 | 
			
		||||
    default: false
 | 
			
		||||
    required: false
 | 
			
		||||
  clean:
 | 
			
		||||
    description: 'Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching'
 | 
			
		||||
    default: true
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										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?
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,6 +42,7 @@ export async function getInputs(): Promise<IGitSourceSettings> {
 | 
			
		|||
    result.repositoryPath
 | 
			
		||||
  )
 | 
			
		||||
  if (
 | 
			
		||||
    !core.getInput('allow-path-outside-workspace') &&
 | 
			
		||||
    !(result.repositoryPath + path.sep).startsWith(
 | 
			
		||||
      githubWorkspacePath + path.sep
 | 
			
		||||
    )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue