Merge pull request #1102 from yyyangw/patch-2 #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync-To-TGIT | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
push-to-mirror: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone | |
run: | | |
git init | |
git remote add origin https://github.com/${GITHUB_REPOSITORY}.git | |
git fetch --all | |
for branch in `git branch -a | grep remotes | grep -v HEAD`; do | |
git branch --track ${branch##*/} $branch | |
done | |
env: | |
GITHUB_REPOSITORY: Tencent/CodeAnalysis | |
- name: Push to TGIT | |
run: | | |
remote_repo="https://${TGIT_USERNAME}:${TGIT_PASSWORD}@git.code.tencent.com/${TGIT_REPOSITORY}.git" | |
git remote add tencent "${remote_repo}" | |
git show-ref | |
git branch --verbose | |
git push --all --force tencent | |
git push --tags --force tencent | |
env: | |
TGIT_REPOSITORY: Tencent_Open_Source/CodeAnalysis | |
TGIT_USERNAME: ${{ secrets.USERNAME }} | |
TGIT_PASSWORD: ${{ secrets.PASSWORD }} | |
- name: Push to Gitee | |
run: | | |
remote_repo="https://${GITEE_USERNAME}:${GITEE_PASSWORD}@gitee.com/${GITEE_REPOSITORY}.git" | |
git remote add gitee "${remote_repo}" | |
git show-ref | |
git branch --verbose | |
git push --all --force gitee | |
git push --tags --force gitee | |
env: | |
GITEE_REPOSITORY: zhang9w0v5/CodeAnalysis | |
GITEE_USERNAME: ${{ secrets.GITEE_USERNAME }} | |
GITEE_PASSWORD: ${{ secrets.GITEE_PASSWORD }} | |