File tree Expand file tree Collapse file tree 3 files changed +24
-8
lines changed Expand file tree Collapse file tree 3 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 1515 uses : ./
1616 with :
1717 base_ref : 027b33661ae3211230e8cd03d19df49ba620b379
18- head_ref : 182a672418c5bae4d6b7ca1244da5f28bf5ff6f0
18+ head_ref : ${{ github.sha }}
1919 kustomizations : |-
2020 testdata/prod
2121 testdata/stage
Original file line number Diff line number Diff line change @@ -4,25 +4,42 @@ set -eux
44
55build_dir=$( mktemp -d)
66
7- build () {
7+ build_base () {
88 ref=" $1 "
99 git checkout " $1 " --quiet
1010
1111 for target in $INPUT_KUSTOMIZATIONS ; do
12- echo " Building $target " to " $build_dir /$ref /$target "
12+ echo " Building base $target " to " $build_dir /$ref /$target "
1313 mkdir -p " $build_dir /$ref /$target "
14+ if [ ! -d " $target " ]; then
15+ echo " Base $target does not exist. Treating it as an empty dir"
16+ mkdir -p " $target "
17+ else
18+ kustomize build " $target " -o " $build_dir /$ref /$target /"
19+ fi
20+ done
21+ }
22+
23+ build_head () {
24+ ref=" $1 "
25+ git checkout " $1 " --quiet
26+
27+ for target in $INPUT_KUSTOMIZATIONS ; do
28+ echo " Building head $target " to " $build_dir /$ref /$target "
29+ mkdir -p " $build_dir /$ref /$target "
30+ ls -al " $target "
1431 kustomize build " $target " -o " $build_dir /$ref /$target /"
1532 done
1633}
1734
1835git config --global --add safe.directory " $GITHUB_WORKSPACE "
1936
20- build " $INPUT_BASE_REF "
21- build " $INPUT_HEAD_REF "
22-
2337base_ref_build_dir=" $build_dir /$INPUT_BASE_REF "
2438head_ref_build_dir=" $build_dir /$INPUT_HEAD_REF "
2539
40+ build_base " $INPUT_BASE_REF "
41+ build_head " $INPUT_HEAD_REF "
42+
2643set +e
2744for target in $INPUT_KUSTOMIZATIONS ; do
2845 diffoscope " $base_ref_build_dir /$target " " $head_ref_build_dir /$target " \
Original file line number Diff line number Diff line change 1- The point of this folder is to test that if the base commit does not contain this folder,
2- the action is still successful
1+ The point of this folder is to test that if the base commit does not contain this folder, the action is still successful
You can’t perform that action at this time.
0 commit comments