Skip to content

Commit 9a731ac

Browse files
authored
Re-enable trigger on pr (#237)
2 parents a744d92 + 730b16c commit 9a731ac

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

.github/workflows/NativePipeline.yml

+15-6
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ on:
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

6666
permissions:
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
@@ -90,6 +98,7 @@ jobs:
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

0 commit comments

Comments
 (0)