File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed
Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 4343 id : generate-matrix
4444 run : |
4545 bash cicd-deployment-scripts/pi/matrix.sh \
46- -p "${{ github.event.pull_request.number }}" \
46+ -p "${{ github.event.pull_request.number || '' }}" \
4747 -s cicd-deployment-scripts/pi/settings.sh \
4848 -t "${{ inputs.parent_image_type }}"
Original file line number Diff line number Diff line change 1717
1818source $SOURCE_SCRIPT
1919
20- UPDATED_FILES=$( gh pr diff $PR_NUMBER --name-only)
2120UPDATED_PARENT_TYPES=()
22- while IFS= read -r file; do
23- if [[ $file != requirements/* ]] || [[ $file != * .in ]]; then
24- continue
25- fi
26-
27- parent_image_type=$( basename $file | sed ' s|-requirements.in||g' )
28- UPDATED_PARENT_TYPES+=($parent_image_type )
2921
30- done <<< " $UPDATED_FILES"
31-
32- if [ -n $PARENT_IMAGE_TYPE ]; then
22+ if [ -n $PR_NUMBER ] && [ -z $PARENT_IMAGE_TYPE ]; then
23+ UPDATED_FILES=$( gh pr diff $PR_NUMBER --name-only)
24+ while IFS= read -r file; do
25+ if [[ $file != requirements/* ]] || [[ $file != * .in ]]; then
26+ continue
27+ fi
28+
29+ parent_image_type=$( basename $file | sed ' s|-requirements.in||g' )
30+ UPDATED_PARENT_TYPES+=($parent_image_type )
31+
32+ done <<< " $UPDATED_FILES"
33+ echo " ::notice::Exporting matrix for parent image types: $UPDATED_PARENT_TYPES "
34+ elif [ -z $PR_NUMBER ] && [ -n $PARENT_IMAGE_TYPE ]; then
35+ echo " ::notice::Exporting matrix for parent image type: $PARENT_IMAGE_TYPE "
3336 UPDATED_PARENT_TYPES=( $PARENT_IMAGE_TYPE )
3437fi
3538
You can’t perform that action at this time.
0 commit comments