Skip to content

Commit 593ded5

Browse files
yeelali14Linearb CI
andauthored
LINBEE-21919-v1 - Improve error handling in git fetch and checkout commands in action.yml (#480)
Co-authored-by: Linearb CI <linearb-ci@gmail.com>
1 parent 7f03799 commit 593ded5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ runs:
8888
cd repo
8989
git fetch --deepen=$all origin $'${{ steps.safe-strings.outputs.base_ref }}'
9090
git remote add upstream $'${{ steps.safe-strings.outputs.url }}'
91-
git fetch --deepen=$all upstream $'${{ steps.safe-strings.outputs.head_ref }}'
92-
git checkout -b $'upstream/${{ steps.safe-strings.outputs.head_ref}}' $'upstream/${{ steps.safe-strings.outputs.head_ref}}'
91+
git fetch --deepen=$all upstream $'${{ steps.safe-strings.outputs.head_ref }}' || echo "::warning::Failed to fetch head branch. The branch may have been deleted."
92+
git checkout -b $'upstream/${{ steps.safe-strings.outputs.head_ref}}' $'upstream/${{ steps.safe-strings.outputs.head_ref}}' || true
9393
shell: bash
9494

9595
- name: Create cm folder

0 commit comments

Comments
 (0)