diff --git a/action.yml b/action.yml index 11420b9f..865c368b 100644 --- a/action.yml +++ b/action.yml @@ -86,10 +86,10 @@ runs: git config checkout.defaultRemote origin git fetch --shallow-since="6 months ago" origin $'${{ steps.safe-strings.outputs.base_ref }}' git remote add upstream $'${{ steps.safe-strings.outputs.url }}' - git fetch --shallow-since="6 months ago" upstream $'${{ steps.safe-strings.outputs.head_ref }}' - git checkout -b $'upstream/${{ steps.safe-strings.outputs.head_ref}}' $'upstream/${{ steps.safe-strings.outputs.head_ref}}' - git checkout $'${{ steps.safe-strings.outputs.base_ref }}' - git checkout $'${{ steps.safe-strings.outputs.head_ref }}' + git fetch --shallow-since="6 months ago" upstream $'${{ steps.safe-strings.outputs.head_ref }}' || echo "::warning::Failed to fetch head branch. The branch may have been deleted." + git checkout -b $'upstream/${{ steps.safe-strings.outputs.head_ref}}' $'upstream/${{ steps.safe-strings.outputs.head_ref}}' || true + git checkout $'${{ steps.safe-strings.outputs.base_ref }}' || true + git checkout $'${{ steps.safe-strings.outputs.head_ref }}' || true - name: Create cm folder shell: bash