Skip to content

Commit

Permalink
Fix mirror - take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
louischan-oursky committed Jan 24, 2025
1 parent 7ef4501 commit 22d692c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/mirror.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ jobs:
- name: Mirror
run: |
export GIT_SSH_COMMAND="ssh -v -i ~/.ssh/id_ed25519"
# Print the git version for debugging purpose.
git --version
# Print the output of git show-ref for debugging purpose.
git show-ref
git remote add mirror [email protected]:oursky/authgear-server.git
# The original command is
# git push --tags --force --prune "[email protected]:oursky/authgear-server.git" "refs/remotes/origin/*:refs/heads/*"
#
Expand All @@ -34,8 +40,9 @@ jobs:
#
# So we use `git show-ref` plus some filtering with awk and perl to filter out refs/remotes/origin/HEAD.
# And build the `git push ...` command with xargs.
git show-ref | awk '{ print $2 }' | perl -n -e 'if (/(^refs\/remotes\/origin\/(.+)$)/ ) { if ($2 != "HEAD") { print "$1:refs/heads/$2\n" } }' | xargs -x git push --tags --force --prune "[email protected]:oursky/authgear-server.git"
git show-ref | awk '{ print $2 }' | perl -n -e 'if (/(^refs\/remotes\/origin\/(.+)$)/ ) { if ($2 != "HEAD") { print "$1:refs/heads/$2\n" } }' | xargs -x git push --tags --force --prune mirror
- name: Clean up
if: ${{ always() }}
run: |
rm -f ~/.ssh/id_ed25519
git remote remove mirror

0 comments on commit 22d692c

Please sign in to comment.