Skip to content

Commit 7f71fae

Browse files
committed
fixed CI for PRs
1 parent 7e3e36b commit 7f71fae

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)