Skip to content

Commit 73d4b02

Browse files
authored
Merge pull request #10 from miriamkw/insulin-percent-effect
Insulin percent effect
2 parents ddff308 + 0e5c59d commit 73d4b02

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: CI Workflow
22

3-
# Trigger the workflow when pushing to main (includes PR merges) or on PR events
3+
# Trigger on PR events and direct pushes to main (but not PR merges)
44
on:
55
push:
66
branches:
@@ -47,13 +47,27 @@ jobs:
4747
pytest
4848
4949
- name: Commit and push the generated .dylib file
50-
if: github.ref == 'refs/heads/main'
50+
# Skip if this is a PR merge (indicated by commit message containing "Merge pull request")
51+
if: github.event_name == 'pull_request' || !contains(github.event.head_commit.message, 'Merge pull request')
5152
run: |
5253
git config --local user.name "GitHub Action"
5354
git config --local user.email "action@github.com"
55+
56+
# Determine target branch
57+
if [ "${{ github.event_name }}" = "pull_request" ]; then
58+
TARGET_BRANCH="${{ github.event.pull_request.head.ref }}"
59+
else
60+
TARGET_BRANCH="${{ github.ref_name }}"
61+
fi
62+
63+
# Fetch and checkout the target branch
5464
git fetch origin
55-
git pull origin ${{ github.ref_name }} --rebase
65+
git checkout -B $TARGET_BRANCH origin/$TARGET_BRANCH
66+
67+
# Add and commit the .dylib file
5668
git add ./loop_to_python_api/libLoopAlgorithmToPython.dylib
5769
git commit -m "Add generated libLoopAlgorithmToPython.dylib" || echo "No changes to commit"
58-
git push origin HEAD:${{ github.ref_name }}
70+
71+
# Push to the target branch
72+
git push origin $TARGET_BRANCH
5973
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)