Skip to content

Commit b7a2991

Browse files
committed
wip
1 parent acdd808 commit b7a2991

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,27 @@ jobs:
1919
- name: Detect changes
2020
id: changes
2121
run: |
22-
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q "^nx/"; then
22+
if [ "${{ github.event_name }}" = "pull_request" ]; then
23+
# For PRs, compare with the base branch
24+
BASE_SHA="${{ github.event.pull_request.base.sha }}"
25+
else
26+
# For pushes, use the previous commit
27+
BASE_SHA="${{ github.event.before }}"
28+
fi
29+
30+
if git diff --name-only $BASE_SHA ${{ github.sha }} | grep -q "^nx/"; then
2331
echo "nx=true" >> $GITHUB_OUTPUT
2432
else
2533
echo "nx=false" >> $GITHUB_OUTPUT
2634
fi
2735
28-
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q "^exla/"; then
36+
if git diff --name-only $BASE_SHA ${{ github.sha }} | grep -q "^exla/"; then
2937
echo "exla=true" >> $GITHUB_OUTPUT
3038
else
3139
echo "exla=false" >> $GITHUB_OUTPUT
3240
fi
3341
34-
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q "^torchx/"; then
42+
if git diff --name-only $BASE_SHA ${{ github.sha }} | grep -q "^torchx/"; then
3543
echo "torchx=true" >> $GITHUB_OUTPUT
3644
else
3745
echo "torchx=false" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)