Skip to content

Commit 2a6de0f

Browse files
authored
[MOO-2137] Improve widget building and trigger on PR (#385)
2 parents 450ba3d + cc72d62 commit 2a6de0f

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/scripts/determine-widget-scope.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ input_workspace="$2"
77
before_commit="$3"
88
current_commit="$4"
99

10-
# List of all native widgets
11-
all_widgets='["accordion-native","activity-indicator-native","animation-native","app-events-native","background-gradient-native","background-image-native","badge-native","bar-chart-native","barcode-scanner-native","bottom-sheet-native","carousel-native","color-picker-native","column-chart-native","feedback-native","floating-action-button-native","gallery-native","gallery-text-filter-native","image-native","intro-screen-native","line-chart-native","listview-swipe-native","maps-native","pie-doughnut-chart-native","popup-menu-native","progress-bar-native","progress-circle-native","qr-code-native","radio-buttons-native","range-slider-native","rating-native","repeater-native","safe-area-view-native","signature-native","slider-native","switch-native","toggle-buttons-native","video-player-native","web-view-native"]'
10+
# Dynamically discover all native widgets from the packages/pluggableWidgets directory
11+
# This ensures we don't miss any widgets when new ones are added
12+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
13+
repo_root="$(cd "$script_dir/../.." && pwd)"
14+
widget_dirs=$(find "$repo_root/packages/pluggableWidgets" -maxdepth 1 -type d -name "*-native" -exec basename {} \; | sort)
15+
all_widgets=$(echo "$widget_dirs" | jq -R -s -c 'split("\n") | map(select(length > 0))')
1216

1317
# Combined widgets and JS actions for default cases
14-
all_widgets_and_js='["accordion-native","activity-indicator-native","animation-native","app-events-native","background-gradient-native","background-image-native","badge-native","bar-chart-native","barcode-scanner-native","bottom-sheet-native","carousel-native","color-picker-native","column-chart-native","feedback-native","floating-action-button-native","gallery-native","gallery-text-filter-native","image-native","intro-screen-native","line-chart-native","listview-swipe-native","maps-native","pie-doughnut-chart-native","popup-menu-native","progress-bar-native","progress-circle-native","qr-code-native","radio-buttons-native","range-slider-native","rating-native","repeater-native","safe-area-view-native","signature-native","slider-native","switch-native","toggle-buttons-native","video-player-native","web-view-native","mobile-resources-native","nanoflow-actions-native"]'
18+
all_widgets_and_js=$(echo "$widget_dirs" | jq -R -s -c 'split("\n") | map(select(length > 0)) + ["mobile-resources-native", "nanoflow-actions-native"]')
1519

1620
if [ "$event_name" == "pull_request" ]; then
1721
if git cat-file -e "$before_commit" 2>/dev/null; then

.github/workflows/NativePipeline.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ on:
2424
required: true
2525
default: "*-native"
2626
type: choice
27+
# NOTE: This list must be kept in sync with packages/pluggableWidgets/*-native folders
28+
# The determine-widget-scope.sh script automatically discovers widgets, but GitHub Actions
29+
# doesn't support dynamic dropdown options, so this list must be updated manually when
30+
# adding or removing widgets.
2731
options:
2832
- "*-native"
2933
- js-actions
@@ -49,6 +53,7 @@ on:
4953
- line-chart-native
5054
- listview-swipe-native
5155
- maps-native
56+
- notifications-native
5257
- pie-doughnut-chart-native
5358
- popup-menu-native
5459
- progress-bar-native
@@ -68,6 +73,8 @@ on:
6873

6974
# Trigger on PR
7075
pull_request:
76+
branches:
77+
- version/mx/10
7178

7279
# Use default name in case no input
7380
run-name: ${{ github.event.inputs.run_name || 'Run Native Pipeline' }}

0 commit comments

Comments
 (0)