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