fix: bug with retrieving the base sha when since last commit is enabled (#1213)
Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
		
							parent
							
								
									72cf8893fc
								
							
						
					
					
						commit
						9ecc6e7fe2
					
				
							
								
								
									
										11
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							| @ -436,16 +436,9 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has | |||||||
|         if (inputs.sinceLastRemoteCommit) { |         if (inputs.sinceLastRemoteCommit) { | ||||||
|             previousSha = env.GITHUB_EVENT_BEFORE; |             previousSha = env.GITHUB_EVENT_BEFORE; | ||||||
|             if (!previousSha) { |             if (!previousSha) { | ||||||
|                 previousSha = yield (0, utils_1.getRemoteBranchHeadSha)({ |                 previousSha = yield (0, utils_1.getParentSha)({ cwd: workingDirectory }); | ||||||
|                     cwd: workingDirectory, |  | ||||||
|                     branch: currentBranch |  | ||||||
|                 }); |  | ||||||
|             } |             } | ||||||
|             if ((yield (0, utils_1.verifyCommitSha)({ |             if (!previousSha) { | ||||||
|                 sha: previousSha, |  | ||||||
|                 cwd: workingDirectory, |  | ||||||
|                 showAsErrorMessage: false |  | ||||||
|             })) !== 0) { |  | ||||||
|                 previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA; |                 previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -360,19 +360,10 @@ export const getSHAForPullRequestEvent = async ( | |||||||
|       previousSha = env.GITHUB_EVENT_BEFORE |       previousSha = env.GITHUB_EVENT_BEFORE | ||||||
| 
 | 
 | ||||||
|       if (!previousSha) { |       if (!previousSha) { | ||||||
|         previousSha = await getRemoteBranchHeadSha({ |         previousSha = await getParentSha({cwd: workingDirectory}) | ||||||
|           cwd: workingDirectory, |  | ||||||
|           branch: currentBranch |  | ||||||
|         }) |  | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       if ( |       if (!previousSha) { | ||||||
|         (await verifyCommitSha({ |  | ||||||
|           sha: previousSha, |  | ||||||
|           cwd: workingDirectory, |  | ||||||
|           showAsErrorMessage: false |  | ||||||
|         })) !== 0 |  | ||||||
|       ) { |  | ||||||
|         previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA |         previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA | ||||||
|       } |       } | ||||||
|     } else { |     } else { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tonye Jack
						Tonye Jack