diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync-develop.yaml similarity index 100% rename from .github/workflows/sync.yaml rename to .github/workflows/sync-develop.yaml diff --git a/.github/workflows/sync-main.yaml b/.github/workflows/sync-main.yaml new file mode 100644 index 0000000..5436478 --- /dev/null +++ b/.github/workflows/sync-main.yaml @@ -0,0 +1,31 @@ +name: Synchronize to forked repo +on: + push: + branches: + - main +jobs: + sync: + name: Sync forked repo + runs-on: ubuntu-latest + + steps: + - name: Checkout main + uses: actions/checkout@v4 + with: + token: ${{ secrets.AUTO_ACTIONS }} + fetch-depth: 0 + ref: main + + - name: Add remote-url + run: | + git remote add forked-repo https://cskime:${{ secrets.AUTO_ACTIONS }}@github.com/cskime/rolling + git config user.name cskime + git config user.email ${{ secrets.EMAIL }} + + - name: Push changes to forked-repo + run: | + git push -f forked-repo main + + - name: Clean up + run: | + git remote remove forked-repo