Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions .github/workflows/NativePipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ on:
- switch-native
- toggle-buttons-native
- video-player-native
- web-view-native
- web-view-native

# Trigger on PR
pull_request:

# Disable trigger on every push to pull request for now
# pull_request:
# # branches: [master]

permissions:
packages: write
Expand All @@ -75,12 +75,20 @@ jobs:
steps:
- name: "Check out code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

with:
fetch-depth: 2 # Fetch the latest two commits and its parent commit

- name: "Determine scope"
id: scope
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
if git cat-file -e ${{ github.event.before }} 2>/dev/null; then
changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
else
echo "Previous commit not found, using HEAD~1 as fallback"
changed_files=$(git diff --name-only HEAD~1 ${{ github.sha }})
fi

selected_workspaces=""
for file in $changed_files; do
if [[ $file == packages/pluggableWidgets/* ]]; then
Expand All @@ -90,6 +98,7 @@ jobs:
fi
fi
done

if [[ -n "$selected_workspaces" ]]; then
echo "scope=--all --include '$selected_workspaces'" >> $GITHUB_OUTPUT
echo "widgets=[\"$selected_workspaces\"]" >> $GITHUB_OUTPUT
Expand Down
Loading