File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 5757 - switch-native
5858 - toggle-buttons-native
5959 - video-player-native
60- - web-view-native
60+ - web-view-native
61+
62+ # Trigger on PR
63+ pull_request :
6164
62- # Disable trigger on every push to pull request for now
63- # pull_request:
64- # # branches: [master]
6565
6666permissions :
6767 packages : write
@@ -75,12 +75,20 @@ jobs:
7575 steps :
7676 - name : " Check out code"
7777 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
78-
78+ with :
79+ fetch-depth : 2 # Fetch the latest two commits and its parent commit
80+
7981 - name : " Determine scope"
8082 id : scope
8183 run : |
8284 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+
8492 selected_workspaces=""
8593 for file in $changed_files; do
8694 if [[ $file == packages/pluggableWidgets/* ]]; then
9098 fi
9199 fi
92100 done
101+
93102 if [[ -n "$selected_workspaces" ]]; then
94103 echo "scope=--all --include '$selected_workspaces'" >> $GITHUB_OUTPUT
95104 echo "widgets=[\"$selected_workspaces\"]" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments