breadcrumbs/.forgejo/workflows/mirror.yml
Breadway 5f18df69c0
Some checks failed
Mirror to GitHub / mirror (push) Failing after 1s
Rename mirror secret to MIRROR_TOKEN (GITHUB_ prefix is reserved)
Forgejo/gitea rejects user secret names starting with GITHUB_.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 16:10:50 +08:00

21 lines
675 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
git clone --mirror "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" repo.git
cd repo.git
# Mirror only branches and tags (not refs/pull/*, which GitHub rejects);
# --prune deletes GitHub refs that no longer exist on Forgejo.
git push --prune \
"https://x-access-token:${{ secrets.MIRROR_TOKEN }}@github.com/Breadway/breadcrumbs.git" \
'+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*'