mirror of
				https://github.com/actions/checkout.git
				synced 2025-10-28 16:18:37 +08:00 
			
		
		
		
	Compare commits
	
		
			6 Commits
		
	
	
		
			a7fcda9e31
			...
			75317902be
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 75317902be | ||
|   | 2bcd7c6585 | ||
|   | 857facff5c | ||
|   | ff9f98e487 | ||
|   | aa7e6581cb | ||
|   | 6397f22a4f | 
							
								
								
									
										11
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							|  | @ -299,15 +299,18 @@ jobs: | |||
|   test-output: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       # Clone this repo | ||||
|       # Download the action at the current ref | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4.1.6 | ||||
|         with: | ||||
|           path: actions-checkout | ||||
| 
 | ||||
|       # Basic checkout using git | ||||
|       - name: Checkout basic | ||||
|         id: checkout | ||||
|         uses: ./ | ||||
|         uses: ./actions-checkout | ||||
|         with: | ||||
|           path: cloned-using-local-action | ||||
|           ref: test-data/v2/basic | ||||
| 
 | ||||
|       # Verify output | ||||
|  | @ -325,7 +328,3 @@ jobs: | |||
|             echo "Expected commit to be 82f71901cf8c021332310dcc8cdba84c4193ff5d" | ||||
|             exit 1 | ||||
|           fi | ||||
| 
 | ||||
|       # needed to make checkout post cleanup succeed | ||||
|       - name: Fix Checkout | ||||
|         uses: actions/checkout@v4.1.6 | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ fi | |||
| 
 | ||||
| echo "Testing persisted credential" | ||||
| pushd ./submodules-recursive/submodule-level-1/submodule-level-2 | ||||
| git config --local --name-only --get-regexp http.+extraheader && git fetch | ||||
| git config --local --name-only --get-regexp '^includeIf\.' && git fetch | ||||
| if [ "$?" != "0" ]; then | ||||
|     echo "Failed to validate persisted credential" | ||||
|     popd | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ fi | |||
| 
 | ||||
| echo "Testing persisted credential" | ||||
| pushd ./submodules-true/submodule-level-1 | ||||
| git config --local --name-only --get-regexp http.+extraheader && git fetch | ||||
| git config --local --name-only --get-regexp '^includeIf\.' && git fetch | ||||
| if [ "$?" != "0" ]; then | ||||
|     echo "Failed to validate persisted credential" | ||||
|     popd | ||||
|  |  | |||
							
								
								
									
										14
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							|  | @ -289,15 +289,15 @@ class GitAuthHelper { | |||
|                 // For each submodule, configure includeIf entries pointing to the shared credentials file.
 | ||||
|                 // Configure both host and container paths to support Docker container actions.
 | ||||
|                 for (const configPath of configPaths) { | ||||
|                     // The config file is at .git/modules/submodule-name/config
 | ||||
|                     let submoduleConfigDir = path.dirname(configPath); | ||||
|                     submoduleConfigDir = submoduleConfigDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
 | ||||
|                     // Submodule Git directory
 | ||||
|                     let submoduleGitDir = path.dirname(configPath); // The config file is at .git/modules/submodule-name/config
 | ||||
|                     submoduleGitDir = submoduleGitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
 | ||||
|                     // Configure host includeIf
 | ||||
|                     yield this.git.config(`includeIf.gitdir:${submoduleConfigDir}.path`, credentialsConfigPath, false, false, configPath); | ||||
|                     yield this.git.config(`includeIf.gitdir:${submoduleGitDir}.path`, credentialsConfigPath, false, false, configPath); | ||||
|                     // Configure container includeIf
 | ||||
|                     let relativeSubmoduleConfigDir = path.relative(githubWorkspace, submoduleConfigDir); | ||||
|                     relativeSubmoduleConfigDir = relativeSubmoduleConfigDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
 | ||||
|                     const containerSubmoduleGitDir = path.posix.join('/github/workspace', relativeSubmoduleConfigDir); | ||||
|                     let relativeSubmoduleGitDir = path.relative(githubWorkspace, submoduleGitDir); | ||||
|                     relativeSubmoduleGitDir = relativeSubmoduleGitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
 | ||||
|                     const containerSubmoduleGitDir = path.posix.join('/github/workspace', relativeSubmoduleGitDir); | ||||
|                     yield this.git.config(`includeIf.gitdir:${containerSubmoduleGitDir}.path`, containerCredentialsPath, false, false, configPath); | ||||
|                 } | ||||
|                 if (this.settings.sshKey) { | ||||
|  |  | |||
|  | @ -205,13 +205,13 @@ class GitAuthHelper { | |||
|       // For each submodule, configure includeIf entries pointing to the shared credentials file.
 | ||||
|       // Configure both host and container paths to support Docker container actions.
 | ||||
|       for (const configPath of configPaths) { | ||||
|         // The config file is at .git/modules/submodule-name/config
 | ||||
|         let submoduleConfigDir = path.dirname(configPath) | ||||
|         submoduleConfigDir = submoduleConfigDir.replace(/\\/g, '/') // Use forward slashes, even on Windows
 | ||||
|         // Submodule Git directory
 | ||||
|         let submoduleGitDir = path.dirname(configPath) // The config file is at .git/modules/submodule-name/config
 | ||||
|         submoduleGitDir = submoduleGitDir.replace(/\\/g, '/') // Use forward slashes, even on Windows
 | ||||
| 
 | ||||
|         // Configure host includeIf
 | ||||
|         await this.git.config( | ||||
|           `includeIf.gitdir:${submoduleConfigDir}.path`, | ||||
|           `includeIf.gitdir:${submoduleGitDir}.path`, | ||||
|           credentialsConfigPath, | ||||
|           false, | ||||
|           false, | ||||
|  | @ -219,17 +219,14 @@ class GitAuthHelper { | |||
|         ) | ||||
| 
 | ||||
|         // Configure container includeIf
 | ||||
|         let relativeSubmoduleConfigDir = path.relative( | ||||
|         let relativeSubmoduleGitDir = path.relative( | ||||
|           githubWorkspace, | ||||
|           submoduleConfigDir | ||||
|           submoduleGitDir | ||||
|         ) | ||||
|         relativeSubmoduleConfigDir = relativeSubmoduleConfigDir.replace( | ||||
|           /\\/g, | ||||
|           '/' | ||||
|         ) // Use forward slashes, even on Windows
 | ||||
|         relativeSubmoduleGitDir = relativeSubmoduleGitDir.replace(/\\/g, '/') // Use forward slashes, even on Windows
 | ||||
|         const containerSubmoduleGitDir = path.posix.join( | ||||
|           '/github/workspace', | ||||
|           relativeSubmoduleConfigDir | ||||
|           relativeSubmoduleGitDir | ||||
|         ) | ||||
|         await this.git.config( | ||||
|           `includeIf.gitdir:${containerSubmoduleGitDir}.path`, | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user