File tree 1 file changed +15
-6
lines changed
1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 57
57
- switch-native
58
58
- toggle-buttons-native
59
59
- video-player-native
60
- - web-view-native
60
+ - web-view-native
61
+
62
+ # Trigger on PR
63
+ pull_request :
61
64
62
- # Disable trigger on every push to pull request for now
63
- # pull_request:
64
- # # branches: [master]
65
65
66
66
permissions :
67
67
packages : write
@@ -75,12 +75,20 @@ jobs:
75
75
steps :
76
76
- name : " Check out code"
77
77
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
78
-
78
+ with :
79
+ fetch-depth : 2 # Fetch the latest two commits and its parent commit
80
+
79
81
- name : " Determine scope"
80
82
id : scope
81
83
run : |
82
84
if [ "${{ github.event_name }}" == "pull_request" ]; then
83
- changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
85
+ if git cat-file -e ${{ github.event.before }} 2>/dev/null; then
86
+ changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
87
+ else
88
+ echo "Previous commit not found, using HEAD~1 as fallback"
89
+ changed_files=$(git diff --name-only HEAD~1 ${{ github.sha }})
90
+ fi
91
+
84
92
selected_workspaces=""
85
93
for file in $changed_files; do
86
94
if [[ $file == packages/pluggableWidgets/* ]]; then
90
98
fi
91
99
fi
92
100
done
101
+
93
102
if [[ -n "$selected_workspaces" ]]; then
94
103
echo "scope=--all --include '$selected_workspaces'" >> $GITHUB_OUTPUT
95
104
echo "widgets=[\"$selected_workspaces\"]" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments