Skip to content

Commit

Permalink
sync fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zimbatm committed Dec 7, 2023
1 parent 9c8ab40 commit 127b9b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
# Our ./sync.sh script needs the whole history
fetch-depth: 0
- uses: cachix/install-nix-action@v15
- name: configure git
run: |
Expand Down
4 changes: 3 additions & 1 deletion sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ trap cleanup EXIT

# Get the latest commit from that branch
git fetch origin "refs/heads/main"
git fetch origin "refs/heads/$branch" || true
if ! git fetch origin "refs/heads/$branch"; then
git branch "$branch"
fi

# Checkout that branch in a temporary worktree
git worktree add -f "$workdir" "$branch"
Expand Down

0 comments on commit 127b9b1

Please sign in to comment.