From 39da0643b49fe00980c835d3896d992a1a44a858 Mon Sep 17 00:00:00 2001 From: Melorise <0d00@0721.hk> Date: Thu, 27 Aug 2026 11:12:30 +0800 Subject: [PATCH] fix:no shallow clone --- .github/workflows/mirror-nixpkgs.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/mirror-nixpkgs.yml b/.github/workflows/mirror-nixpkgs.yml index 44e2f2930..e7de73d78 100644 --- a/.github/workflows/mirror-nixpkgs.yml +++ b/.github/workflows/mirror-nixpkgs.yml @@ -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