This repository was archived by the owner on Jan 23, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -72,14 +72,29 @@ jobs:
7272 - name : Checkout specific branch in submodule
7373 run : |
7474 cd cpp/memgraph
75- if [ -z "${{ inputs.memgraph_ref }}" ] || ! git checkout "${{ inputs.memgraph_ref }}"; then
76- # this may happen if we're using a daily build not directly from master
77- echo "Checkout of '${{ inputs. memgraph_ref }}' failed , checking out master instead ."
75+ # If no ref is provided, just checkout master.
76+ if [ -z "${{ inputs.memgraph_ref }}" ]; then
77+ echo "No memgraph_ref provided , checking out master."
7878 git checkout master
79+ else
80+ # Temporarily disable exit-on-error to capture the failure of checkout.
81+ set +e
82+ git checkout "${{ inputs.memgraph_ref }}"
83+ checkout_status=$?
84+ # Re-enable exit-on-error.
85+ set -e
86+
87+ # If the checkout failed, fallback to master.
88+ if [ $checkout_status -ne 0 ]; then
89+ echo "Checkout of '${{ inputs.memgraph_ref }}' failed, checking out master instead."
90+ git checkout master
91+ fi
7992 fi
93+ echo "DEBUG: Last status $?"
8094
8195 # Only pull if we are on a branch.
8296 current_branch=$(git symbolic-ref --short -q HEAD)
97+ echo "Current branch: $current_branch"
8398 if [ -n "$current_branch" ]; then
8499 if [[ "${{ inputs.memgraph_ref_update }}" == "true" ]]; then
85100 git pull
You can’t perform that action at this time.
0 commit comments