From ce7b7ef2dbc6d53c79f4ba409febec2373dafffb Mon Sep 17 00:00:00 2001 From: drifty Date: Sat, 22 Feb 2025 10:44:24 +0530 Subject: [PATCH] Update github-codeberg.yml --- .github/workflows/github-codeberg.yml | 40 +++++++++++++++++++-------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/.github/workflows/github-codeberg.yml b/.github/workflows/github-codeberg.yml index af02fc9..f210cf1 100644 --- a/.github/workflows/github-codeberg.yml +++ b/.github/workflows/github-codeberg.yml @@ -1,11 +1,29 @@ -on: [push] - ... - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: yesolutions/mirror-action@master - with: - REMOTE: 'https://codeberg.org/driftywinds/yt-builds.git' - GIT_USERNAME: driftywinds - GIT_PASSWORD: ${{ secrets.GIT_PASSWORD }} +# Sync repo to the Forgejo mirror +name: Repo sync (GitHub -> Forgejo) +on: + push: + branches: + - '**' + workflow_dispatch: # Manual dispatch + schedule: + - cron: "0 */6 * * *" + +jobs: + sync-repo-to-forgejo: + runs-on: ubuntu-latest + steps: + - name: "Checkout" + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: "Gather facts" + run: | + echo "Repo variables:" + echo " FORGEJO_PUSH_URL: ${{ vars.FORGEJO_BASE_URL }}${{ vars.FORGEJO_REPO }}.git" + echo " FORGEJO_USERNAME: ${{ vars.FORGEJO_USERNAME }}" + - name: "Sync repo" + uses: spyoungtech/mirror-action@master + with: + REMOTE: "${{ vars.FORGEJO_BASE_URL }}${{ vars.FORGEJO_REPO }}.git" + GIT_USERNAME: ${{ vars.FORGEJO_USERNAME }} + GIT_PASSWORD: ${{ secrets._FORGEJO_TOKEN }}