File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments