File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,22 @@ jobs:
5252 run : |
5353 git config --local user.name "GitHub Action"
5454 git config --local user.email "action@github.com"
55- git add ./loop_to_python_api/libLoopAlgorithmToPython.dylib
56- git commit -m "Add generated libLoopAlgorithmToPython.dylib" || echo "No changes to commit"
55+
56+ # Determine target branch
5757 if [ "${{ github.event_name }}" = "pull_request" ]; then
58- git push origin HEAD: ${{ github.event.pull_request.head.ref }}
58+ TARGET_BRANCH=" ${{ github.event.pull_request.head.ref }}"
5959 else
60- git push origin HEAD: ${{ github.ref_name }}
60+ TARGET_BRANCH=" ${{ github.ref_name }}"
6161 fi
62+
63+ # Fetch and checkout the target branch
64+ git fetch origin
65+ git checkout -B $TARGET_BRANCH origin/$TARGET_BRANCH
66+
67+ # Add and commit the .dylib file
68+ git add ./loop_to_python_api/libLoopAlgorithmToPython.dylib
69+ git commit -m "Add generated libLoopAlgorithmToPython.dylib" || echo "No changes to commit"
70+
71+ # Push to the target branch
72+ git push origin $TARGET_BRANCH
6273
You can’t perform that action at this time.
0 commit comments