diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 0cb523c..bbbf3d9 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -9,19 +9,22 @@ jobs: steps: - name: Checkout the private repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 + with: + token: ${{ secrets.PAT_TOKEN }} - - name: Set up SSH - run: | - mkdir -p ~/.ssh - echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh-keyscan github.com >> ~/.ssh/known_hosts + - name: Checkout the Public Repo + uses: actions/checkout@v3 + with: + repository: ClashKingInc/ClashKingAssets + token: ${{ secrets.PAT_TOKEN }} + path: public_repo - name: Sync to Public Repo run: | git config --global user.name "MagicTheDev" - git remote add public git@github.com:ClashKingInc/ClashKingAssets.git + cd public_repo + cp -R ../. . git add . git commit -m "Sync to public repo" || echo "No changes to commit" - git push --force public main + git push --force