breadpaper/.forgejo/workflows/mirror.yml
Breadway 44287fe83a
Some checks failed
Mirror to GitHub / mirror (push) Failing after 4s
debug: print git config and env in mirror step
2026-06-17 14:35:41 +08:00

22 lines
732 B
YAML

name: Mirror to GitHub
on:
push:
branches: ['**']
tags: ['**']
jobs:
mirror:
runs-on: [self-hosted, hestia]
steps:
- name: Mirror to GitHub
run: |
set -euo pipefail
echo "GITHUB_REPOSITORY=${GITHUB_REPOSITORY}"
echo "GITHUB_SERVER_URL=${GITHUB_SERVER_URL:-unset}"
git config --list --global | grep -E "url|insteadOf" || echo "(no url rewrites)"
git clone --mirror "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" repo.git
cd repo.git
git push --prune \
"https://x-access-token:${{ secrets.MIRROR_TOKEN }}@github.com/Breadway/breadpaper.git" \
'+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*'