Merge pull request #847 from tj-actions/chore/update-error-handling
chore: update error handling
This commit is contained in:
		
						commit
						3f1e44af6c
					
				| @ -221,19 +221,18 @@ else | ||||
|         max_depth=$INPUT_MAX_FETCH_DEPTH | ||||
| 
 | ||||
|         for ((i=0; i<max_depth; i+=depth)); do | ||||
|           echo "Fetching $depth commits..." | ||||
|           echo "Fetching $i commits..." | ||||
| 
 | ||||
|           # shellcheck disable=SC2086 | ||||
|           git fetch $EXTRA_ARGS -u --progress --deepen="$depth" origin +"$GITHUB_REF":refs/remotes/origin/"$CURRENT_BRANCH" | ||||
|           git fetch $EXTRA_ARGS -u --progress --deepen="$i" origin +"$GITHUB_REF":refs/remotes/origin/"$CURRENT_BRANCH" | ||||
| 
 | ||||
|           if git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then | ||||
|             PREVIOUS_SHA=$(git merge-base "$TARGET_BRANCH" "$CURRENT_SHA" 2>&1) && exit_status=$? || exit_status=$? | ||||
|             break | ||||
|           fi | ||||
|         done | ||||
| 
 | ||||
|         if ((i >= max_depth)); then | ||||
|           echo "::error::Unable to locate a common ancestor between $TARGET_BRANCH and $CURRENT_SHA" | ||||
|           echo "::error::Unable to locate a common ancestor between $TARGET_BRANCH and $CURRENT_BRANCH with: $PREVIOUS_SHA$DIFF$CURRENT_SHA" | ||||
|           exit 1 | ||||
|         fi | ||||
|       else | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	![39074581+repo-ranger[bot]@users.noreply.github.com](/assets/img/avatar_default.png) repo-ranger[bot]
						repo-ranger[bot]