Skip to content

Commit d269c61

Browse files
committed
Fix repository sync workflow
1 parent a5caad9 commit d269c61

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/sync-repos.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ jobs:
1616
sync:
1717
runs-on: ubuntu-latest
1818
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
persist-credentials: false
24+
1925
- name: Resolve mirror repository
2026
id: mirror
2127
run: |
@@ -60,7 +66,7 @@ jobs:
6066
GH_TOKEN: ${{ secrets.REPO_SYNC_TOKEN }}
6167
MIRROR_REPO: ${{ steps.mirror.outputs.repo }}
6268
run: |
63-
gh repo sync "${MIRROR_REPO}" \
64-
--source "${{ github.repository }}" \
65-
--branch main \
66-
--force
69+
git config user.name "github-actions[bot]"
70+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
71+
git remote add mirror "https://x-access-token:${GH_TOKEN}@github.com/${MIRROR_REPO}.git"
72+
git push mirror "HEAD:main" --force

0 commit comments

Comments
 (0)