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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '**' # Sync all branches
|
- '**'
|
||||||
delete:
|
delete:
|
||||||
branches:
|
branches:
|
||||||
- '**' # Sync branch deletions
|
- '**'
|
||||||
create:
|
create:
|
||||||
tags:
|
tags:
|
||||||
- '**' # Sync tag creation
|
- '**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sync:
|
sync:
|
||||||
@@ -19,34 +19,22 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
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: |
|
run: |
|
||||||
git config --global user.name "Gitea Actions"
|
git remote add github https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO}.git || true
|
||||||
git config --global user.email "actions@gitea.local"
|
git remote set-url github https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO}.git
|
||||||
|
git push github --all --force
|
||||||
- name: Add GitHub remote
|
git push github --tags --force
|
||||||
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
|
|
||||||
|
|
||||||
- name: Sync status
|
- name: Sync status
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: echo "Successfully synced to GitHub"
|
||||||
echo "✅ Successfully synced to GitHub!"
|
|
||||||
echo "Repository: github.com/${{ secrets.GH_REPO }}"
|
|
||||||
|
|
||||||
- name: Sync failed
|
- name: Sync failed
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: echo "Failed to sync to GitHub"
|
||||||
echo "❌ Failed to sync to GitHub"
|
|
||||||
echo "Check your GitHub credentials and repository path"
|
|
||||||
Reference in New Issue
Block a user