mirror-repository: fetch all

This commit is contained in:
Antoine Martin 2024-08-15 00:55:53 -04:00
parent 7795fb0f52
commit 3f01134419
Signed by: forge
GPG key ID: D62A472A4AA7D541

View file

@ -2,6 +2,8 @@ on:
schedule:
- cron: '@hourly'
workflow_dispatch:
jobs:
mirror:
name: Pull from upstream
@ -9,15 +11,15 @@ jobs:
container:
image: 'docker.io/node:20-bookworm'
steps:
- name: git mirror branches {v*/,}main & tags
- name: git mirror branches {v*/,}* & tags
run: |
git init --bare .
git remote add origin https://github.com/dotnet/installer
git fetch origin refs/heads/main:refs/mirror/main
git ls-remote origin refs/heads/v*/main | while read sha full_ref ; do
git fetch origin refs/heads/*:refs/mirror/*
git ls-remote origin refs/heads/v*/* | while read sha full_ref ; do
ref=${full_ref#refs/heads/}
git fetch origin $full_ref:refs/mirror/$ref
tag=${ref%/main}
tag=${ref}
git fetch origin refs/tags/${tag}*:refs/mirror-tags/${tag}*
done
if test "${{ vars.TEST }}" != true ; then