Skip to content

Commit

Permalink
fix: add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
wei authored Aug 25, 2020
1 parent 5e86432 commit 32f5a76
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions github-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,20 @@ echo "UPSTREAM_REPO=$UPSTREAM_REPO"
echo "BRANCHES=$BRANCH_MAPPING"

git config --unset-all http."https://github.com/".extraheader || :

echo "Resetting origin to: https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY"
git remote set-url origin "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY"

echo "Adding tmp_upstream $UPSTREAM_REPO"
git remote add tmp_upstream "$UPSTREAM_REPO"

echo "Fetching tmp_upstream"
git fetch tmp_upstream
git remote --verbose

echo "Pushing changings from tmp_upstream to origin"
git push origin "refs/remotes/tmp_upstream/${BRANCH_MAPPING%%:*}:refs/heads/${BRANCH_MAPPING#*:}" --force

echo "Removing tmp_upstream"
git remote rm tmp_upstream
git remote --verbose

0 comments on commit 32f5a76

Please sign in to comment.