use composite action for github mirroring
1 file changed, 5 insertions(+), 21 deletions(-)
changed files
M .forgejo/workflows/mirror.yml → .forgejo/workflows/mirror.yml
@@ -7,29 +7,13 @@ jobs: mirror: runs-on: codeberg-tiny-lazy steps: - - name: Check out the repository + - name: Check out 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 + - name: Mirror filtered repository + uses: https://codeberg.org/alinnow/mirror-only-readme@v1.0.1 with: - source: . - target: target + other_forge_token: ${{ secrets.OTHER_FORGE_TOKEN }} + prune_empty: never 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 }}