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
4
4
5
5
build_dir=$( mktemp -d)
6
6
7
- build () {
7
+ build_base () {
8
8
ref=" $1 "
9
9
git checkout " $1 " --quiet
10
10
11
11
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 "
13
13
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 "
14
31
kustomize build " $target " -o " $build_dir /$ref /$target /"
15
32
done
16
33
}
17
34
18
35
git config --global --add safe.directory " $GITHUB_WORKSPACE "
19
36
20
- build " $INPUT_BASE_REF "
21
- build " $INPUT_HEAD_REF "
22
-
23
37
base_ref_build_dir=" $build_dir /$INPUT_BASE_REF "
24
38
head_ref_build_dir=" $build_dir /$INPUT_HEAD_REF "
25
39
40
+ build_base " $INPUT_BASE_REF "
41
+ build_head " $INPUT_HEAD_REF "
42
+
26
43
set +e
27
44
for target in $INPUT_KUSTOMIZATIONS ; do
28
45
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