Skip to content

Commit 73c275c

Browse files
committed
ensure the local remote-tracking ref exists
1 parent e2f1dfd commit 73c275c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ runs:
269269
trap - EXIT
270270
fi
271271
272+
# Ensure local remote-tracking ref exists (actions/checkout often fetches only one branch).
273+
if ! git fetch --no-tags origin +refs/heads/coverage:refs/remotes/origin/coverage; then
274+
echo "Failed to fetch refs/remotes/origin/coverage." >&2
275+
exit 1
276+
fi
277+
272278
- name: Check out coverage branch (worktree)
273279
shell: bash
274280
run: |
@@ -281,7 +287,7 @@ runs:
281287
fi
282288
git worktree prune || true
283289
# Use detached HEAD to avoid branch-name collisions when current checkout is already 'coverage'.
284-
git worktree add --detach "$WORKTREE_DIR" origin/coverage
290+
git worktree add --detach "$WORKTREE_DIR" refs/remotes/origin/coverage
285291
echo "WORKTREE_DIR=$WORKTREE_DIR" >> "$GITHUB_ENV"
286292
echo "Using worktree at $WORKTREE_DIR"
287293

0 commit comments

Comments
 (0)