Skip to content

Commit 91befca

Browse files
alexzhangsclaude
andcommitted
Fix CI: drop redundant workspace-swap that broke version detection
xsh load -b $BRANCH already clones from origin and checks out the branch under test, so copying GITHUB_WORKSPACE on top of the clone is unnecessary. Worse: actions/checkout uses a shallow fetch by default (no tags), so the swap stripped tags from the repo, after which xsh's internal "git describe --tags" failed with "fatal: No names found, cannot describe anything." under set -e. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent dbe8dc7 commit 91befca

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

.github/workflows/ci-unittest.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,12 @@ jobs:
2323
# shellcheck disable=SC1090
2424
source ~/.xshrc
2525
xsh load xsh-lib/core
26-
# Load this lib at the same branch we're testing. Falls back to the
27-
# default branch if the branch hasn't been pushed yet (e.g. PR from a
28-
# fork). The local checkout is what test.sh exercises via xsh, so this
29-
# ensures the version under test matches the workflow run.
26+
# Load this lib at the branch under test. xsh load does a full clone
27+
# from origin and checks out the branch, so the workflow exercises the
28+
# commit that triggered it. Fork PRs fall back to the default branch
29+
# (the source branch isn't on the main repo).
3030
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
3131
xsh load -b "$BRANCH" xsh-lib/git || xsh load xsh-lib/git
32-
# Swap the loaded copy for this checkout so the workflow tests the
33-
# exact files in this commit, not whatever was last pushed.
34-
REPO_HOME="$HOME/.xsh/repo/xsh-lib/git"
35-
rm -rf "$REPO_HOME"
36-
cp -R "$GITHUB_WORKSPACE" "$REPO_HOME"
3732
3833
- name: Run tests
3934
run: |

0 commit comments

Comments
 (0)