24 lines
942 B
YAML
24 lines
942 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}"
|
|
env | grep -iE "^GIT" | sort || echo "(no GIT env vars)"
|
|
git config --list --global | grep -E "url|insteadOf" || echo "(no url rewrites in global gitconfig)"
|
|
git config --list --system 2>/dev/null | grep -E "url|insteadOf" || echo "(no url rewrites in system gitconfig)"
|
|
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/*'
|