fix:no shallow clone

This commit is contained in:
2026-08-27 11:12:30 +08:00
parent df527ac785
commit 39da0643b4
+6 -5
View File
@@ -20,10 +20,11 @@ jobs:
set -euo pipefail
: "${NIX_BRANCH_TOKEN:?Set the NIX_BRANCH_TOKEN repository secret.}"
git clone --bare "https://github.com/NixOS/nixpkgs.git" nixpkgs.git
git -C nixpkgs.git remote add target \
"https://x-access-token:${NIX_BRANCH_TOKEN}@github.com/${TARGET_REPOSITORY}.git"
for branch in nixos-26.05 nixos-unstable; do
git clone --depth=1 --branch "$branch" \
"https://github.com/NixOS/nixpkgs.git" "$branch"
git -C "$branch" remote set-url origin \
"https://x-access-token:${NIX_BRANCH_TOKEN}@github.com/${TARGET_REPOSITORY}.git"
git -C "$branch" push --force origin "HEAD:refs/heads/$branch"
git -C nixpkgs.git push --force target \
"refs/heads/$branch:refs/heads/$branch"
done