Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kalidax committed Nov 23, 2023
1 parent 42a21a6 commit 82bfbc0
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/sync-axelar-repo.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Synchronize to private repo

on:
workflow_dispatch:
push:

jobs:
sync:
Expand All @@ -16,18 +16,9 @@ jobs:

- name: Sync with private repo
run: |
# Add private repo as a remote
git remote add private ${{ secrets.PRIVATE_REPO_URL }}
# Fetch branches from private repo
git fetch private
Push main branch to private repo
git reset --hard origin/main
git push private main --force
# Push release branches to private repo
for branch in $(git branch -r | grep 'origin/releases/'); do
git checkout -b ${branch#origin/} || git checkout ${branch#origin/}
git push private ${branch#origin/} --force
done
# Ensure the remote 'origin' is set up correctly
git remote add origin $(git config --get remote.origin.url) || true
# Set the push URL for the 'origin' remote
git remote set-url --push origin ${{ secrets.PRIVATE_REPO_URL }}
# Push changes using --mirror
git push --mirror

0 comments on commit 82bfbc0

Please sign in to comment.