diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync-develop.yaml similarity index 93% rename from .github/workflows/sync.yaml rename to .github/workflows/sync-develop.yaml index 737c68d..7ca61fd 100644 --- a/.github/workflows/sync.yaml +++ b/.github/workflows/sync-develop.yaml @@ -1,4 +1,4 @@ -name: Synchronize to forked repo +name: Synchronize the develop branch to forked repo on: push: branches: diff --git a/.github/workflows/sync-main.yaml b/.github/workflows/sync-main.yaml new file mode 100644 index 0000000..453e566 --- /dev/null +++ b/.github/workflows/sync-main.yaml @@ -0,0 +1,31 @@ +name: Synchronize the main branch 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