on: push: branches: - main jobs: mirror: runs-on: codeberg-tiny-lazy steps: - name: Check out the repository uses: actions/checkout@v6 with: fetch-depth: 0 - name: Check out the target repository run: | git clone github.com/${{ forgejo.repository }} target || { git init --initial-branch=${{ forgejo.ref_name }} target && git remote set-url origin https://github.com/${{ forgejo.repository }}.git } - name: Filter repository uses: https://codeberg.org/alinnow/filter-repo-action@v1 with: source: . target: target paths: | README.md LICENSE prune_empty: never - name: Push filtered repository run: | cd target git push --force --mirror https://${{ secrets.OTHER_FORGE_TOKEN }}@github.com/${{ forgejo.repository }}