Files
nixpkgs/.github/workflows/mirror-nixpkgs.yml
T
2026-08-27 11:12:30 +08:00

31 lines
866 B
YAML

name: Mirror Nixpkgs Branches
on:
schedule:
- cron: "0 0 * * 2"
workflow_dispatch:
permissions:
contents: write
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Mirror upstream branches
env:
NIX_BRANCH_TOKEN: ${{ secrets.NIX_BRANCH_TOKEN }}
TARGET_REPOSITORY: ${{ github.repository }}
run: |
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 -C nixpkgs.git push --force target \
"refs/heads/$branch:refs/heads/$branch"
done