File tree Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Expand file tree Collapse file tree 2 files changed +23
-7
lines changed 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