breadpaper/.forgejo/workflows/mirror.yml
2026-06-17 14:39:30 +08:00

25 lines
927 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}"
echo "=== workspace git config ==="
cat "${GITHUB_WORKSPACE}/.git/config" 2>/dev/null || echo "(no workspace .git/config)"
echo "=== all git config ==="
git config --list 2>/dev/null | grep -E "url|insteadOf" || echo "(no url rewrites anywhere)"
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/*'