@@ -20,26 +20,28 @@ jobs:
2020 with :
2121 ref : ${{ github.ref }}
2222 persist-credentials : false
23- - name : Pushes to another repository
23+
24+ - name : Pushes to another repo (approach 1)
25+ if : (!contains(github.event.head_commit.message, 'action_v2'))
2426 run : |
27+ TEMP_DIR=$(mktemp -d)
28+ TEMP_DIR_GIT="$TEMP_DIR/python-${{ inputs.exchange_name }}"
29+ git clone https://x-access-token:${{ secrets.API_TOKEN_FOR_CCXT_SINGLE_EXCHANGES }}@github.com/ccxt/python-${{ inputs.exchange_name }}.git $TEMP_DIR_GIT
30+ rsync -av --exclude='.git' ./ $TEMP_DIR_GIT
31+ cd $TEMP_DIR_GIT
2532 git config user.name github-actions
2633 git config user.email [email protected] 27- git remote add prod https://x-access-token:${{ secrets.API_TOKEN_FOR_CCXT_SINGLE_EXCHANGES }}@github.com/ccxt/python-${{ inputs.exchange_name }}.git
28- git config pull.rebase false
29- git fetch --unshallow prod main
30- git pull --allow-unrelated-histories prod main || echo "Git pull failed"
31- git push prod main --force
32-
34+ git add .
35+ git commit -m "build: ${{ github.sha }}"
36+ git push origin main --force
3337
34- # - name: Pushes to another repo (approach 2)
38+ # - name: Pushes to another repository (approach 2)
39+ # if: contains(github.event.head_commit.message, 'action_v2')
3540 # run: |
36- # TEMP_DIR=$(mktemp -d)
37- # TEMP_DIR_GIT="$TEMP_DIR/python-${{ inputs.exchange_name }}"
38- # git clone https://x-access-token:${{ secrets.API_TOKEN_FOR_CCXT_SINGLE_EXCHANGES }}@github.com/ccxt/python-${{ inputs.exchange_name }}.git $TEMP_DIR_GIT
39- # rsync -av --exclude='.git' ./ $TEMP_DIR_GIT
40- # cd $TEMP_DIR_GIT
4141 # git config user.name github-actions
4242 # git config user.email [email protected] 43- # git add .
44- # git commit -m "build: ${{ github.sha }}"
45- # git push origin main --force
43+ # git remote add prod https://x-access-token:${{ secrets.API_TOKEN_FOR_CCXT_SINGLE_EXCHANGES }}@github.com/ccxt/python-${{ inputs.exchange_name }}.git
44+ # git config pull.rebase false
45+ # git fetch --unshallow prod main
46+ # git pull --allow-unrelated-histories prod main || echo "Git pull failed"
47+ # git push prod main --force
0 commit comments