Sync workflow Update
Some checks failed
Build and Release / Build Linux (push) Has been skipped
Sync to GitHub / sync (push) Failing after 41s
Build and Release / Build Windows (push) Has been cancelled
Build and Release / Build macOS (push) Has been cancelled
Build and Release / Create Release (push) Has been cancelled
Build and Release / Development Build (push) Has been cancelled
Some checks failed
Build and Release / Build Linux (push) Has been skipped
Sync to GitHub / sync (push) Failing after 41s
Build and Release / Build Windows (push) Has been cancelled
Build and Release / Build macOS (push) Has been cancelled
Build and Release / Create Release (push) Has been cancelled
Build and Release / Development Build (push) Has been cancelled
This commit is contained in:
@@ -3,13 +3,13 @@ name: Sync to GitHub
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**' # Sync all branches
|
||||
- '**'
|
||||
delete:
|
||||
branches:
|
||||
- '**' # Sync branch deletions
|
||||
- '**'
|
||||
create:
|
||||
tags:
|
||||
- '**' # Sync tag creation
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
@@ -19,34 +19,22 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for all branches and tags
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure Git
|
||||
- name: Push to GitHub
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
GITHUB_REPO: ${{ secrets.GH_REPO }}
|
||||
run: |
|
||||
git config --global user.name "Gitea Actions"
|
||||
git config --global user.email "actions@gitea.local"
|
||||
|
||||
- name: Add GitHub remote
|
||||
run: |
|
||||
git remote add github https://${{ secrets.GH_USERNAME }}:${{ secrets.GH_TOKEN }}@github.com/${{ secrets.GH_REPO }}
|
||||
|
||||
- name: Fetch all branches and tags
|
||||
run: |
|
||||
git fetch --all
|
||||
git fetch --tags
|
||||
|
||||
- name: Push to GitHub (mirror)
|
||||
run: |
|
||||
git push github --mirror --force
|
||||
git remote add github https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO}.git || true
|
||||
git remote set-url github https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO}.git
|
||||
git push github --all --force
|
||||
git push github --tags --force
|
||||
|
||||
- name: Sync status
|
||||
if: success()
|
||||
run: |
|
||||
echo "✅ Successfully synced to GitHub!"
|
||||
echo "Repository: github.com/${{ secrets.GH_REPO }}"
|
||||
run: echo "Successfully synced to GitHub"
|
||||
|
||||
- name: Sync failed
|
||||
if: failure()
|
||||
run: |
|
||||
echo "❌ Failed to sync to GitHub"
|
||||
echo "Check your GitHub credentials and repository path"
|
||||
run: echo "Failed to sync to GitHub"
|
||||
Reference in New Issue
Block a user