diff --git a/.github/workflows/backup.yml b/.github/workflows/backup.yml index 6b8ca7f9..95d60b4f 100644 --- a/.github/workflows/backup.yml +++ b/.github/workflows/backup.yml @@ -25,8 +25,8 @@ jobs: - name: Configure Git run: | - git config --local user.email "miaogongzi0227@gmail.com" - git config --local user.name "mgz0227" + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" - name: Add Backup Branch run: | @@ -36,9 +36,10 @@ jobs: mv main_backup_${BACKUP_DATETIME}.tar.gz backups/ git add -A git commit -m "Auto backup main branch code" - git push origin backup - env: - GH_TOKEN: ${{ secrets.HARMONY_BACKUP }} - - - name: Switch Back to Main Branch - run: git checkout main + + - name: GitHub Push Backup Branch + uses: ad-m/github-push-action@v0.6.0 + with: + github_token: ${{ secrets.HARMONY_BACKUP }} + branch: backup + force: true