forgejo-helm/.forgejo/workflows/mirror.yml
Michael Kriese 270a25b695
Some checks failed
build / lint-node (push) Has been cancelled
build / lint-helm (push) Has been cancelled
build / e2e (v1.28.14+k3s1) (push) Has been cancelled
build / e2e (v1.30.5+k3s1) (push) Has been cancelled
build / e2e (v1.31.1+k3s1) (push) Has been cancelled
build / test-success (push) Has been cancelled
build / publish (push) Has been cancelled
ci: allow workflow dispatch trigger
2024-09-25 08:47:08 +02:00

26 lines
787 B
YAML

on:
schedule:
- cron: '@hourly'
push:
branches:
- 'main'
workflow_dispatch:
jobs:
mirror:
runs-on: docker
steps:
- name: git mirror branches {main,maint/*] & tags
run: |
git init --bare .
git remote add origin https://code.forgejo.org/${{ env.GITHUB_REPOSITORY }}
git fetch origin refs/heads/main:refs/mirror/main --tags
git ls-remote origin refs/heads/main/* | while read sha full_ref ; do
ref=${full_ref#refs/heads/}
git fetch origin $full_ref:refs/mirror/$ref
done
git push --force https://any:$CODEBERG_TOKEN@codeberg.org/forgejo-contrib/forgejo-helm refs/mirror/*:refs/heads/* --tags
env:
CODEBERG_TOKEN: ${{secrets.CODEBERG_TOKEN}}