Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI Workflow

# Trigger the workflow when pushing to main (includes PR merges) or on PR events
# Trigger on PR events and direct pushes to main (but not PR merges)
on:
push:
branches:
Expand Down Expand Up @@ -47,13 +47,27 @@ jobs:
pytest

- name: Commit and push the generated .dylib file
if: github.ref == 'refs/heads/main'
# Skip if this is a PR merge (indicated by commit message containing "Merge pull request")
if: github.event_name == 'pull_request' || !contains(github.event.head_commit.message, 'Merge pull request')
run: |
git config --local user.name "GitHub Action"
git config --local user.email "action@github.com"

# Determine target branch
if [ "${{ github.event_name }}" = "pull_request" ]; then
TARGET_BRANCH="${{ github.event.pull_request.head.ref }}"
else
TARGET_BRANCH="${{ github.ref_name }}"
fi

# Fetch and checkout the target branch
git fetch origin
git pull origin ${{ github.ref_name }} --rebase
git checkout -B $TARGET_BRANCH origin/$TARGET_BRANCH

# Add and commit the .dylib file
git add ./loop_to_python_api/libLoopAlgorithmToPython.dylib
git commit -m "Add generated libLoopAlgorithmToPython.dylib" || echo "No changes to commit"
git push origin HEAD:${{ github.ref_name }}

# Push to the target branch
git push origin $TARGET_BRANCH

Binary file modified loop_to_python_api/libLoopAlgorithmToPython.dylib
Binary file not shown.