File tree Expand file tree Collapse file tree 3 files changed +20
-28
lines changed Expand file tree Collapse file tree 3 files changed +20
-28
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,14 @@ jobs:
15
15
uses : ./
16
16
with :
17
17
base_ref : 027b33661ae3211230e8cd03d19df49ba620b379
18
- head_ref : b887e3e0a09cc67b0d12c1d16200955cdf0f767a
18
+ head_ref : 182a672418c5bae4d6b7ca1244da5f28bf5ff6f0
19
19
kustomizations : |-
20
20
testdata/prod
21
21
testdata/stage
22
22
- run : echo "${{ steps.test-action.outputs.diff }}"
23
23
- uses : mshick/add-pr-comment@v2
24
24
with :
25
- message : " ```${{ steps.test-action.outputs.diff }}```"
25
+ message : |
26
+ ```diff
27
+ ${{ steps.test-action.outputs.diff }}
28
+ ```
Original file line number Diff line number Diff line change 1
- # FROM debian:bookworm-slim
2
-
3
- # ARG TARGETOS
4
- # ARG TARGETARCH
5
- # ARG KUSTOMIZE_VERSION=5.4.3
6
-
7
- # RUN apt-get -yqq update \
8
- # && apt-get -yqq install --no-install-recommends \
9
- # bash \
10
- # curl \
11
- # git \
12
- # ca-certificates \
13
- # && rm -rf /var/lib/apt/lists/*
14
-
15
- # RUN curl -fL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_${TARGETOS}_${TARGETARCH}.tar.gz | tar xz -C /usr/local/bin
16
-
17
- # COPY entrypoint.sh .
18
- # ENTRYPOINT [ "./entrypoint.sh" ]
19
-
20
1
FROM registry.k8s.io/kustomize/kustomize:v5.0.0
21
2
3
+ RUN apk add --no-cache sed && \
4
+ apk add difftastic --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
5
+
22
6
COPY entrypoint.sh .
23
7
ENTRYPOINT [ "./entrypoint.sh" ]
Original file line number Diff line number Diff line change @@ -17,16 +17,21 @@ build() {
17
17
18
18
git config --global --add safe.directory " $GITHUB_WORKSPACE "
19
19
20
- build $INPUT_BASE_REF
21
- build $INPUT_HEAD_REF
20
+ build " $INPUT_BASE_REF "
21
+ build " $INPUT_HEAD_REF "
22
22
23
- diff=" $( git diff --no-index " $build_dir /$INPUT_BASE_REF " " $build_dir /$INPUT_HEAD_REF " ) "
24
- escaped_output= $diff # TODO Escape output
23
+ diff=" $( GIT_EXTERNAL_DIFF=difft git diff --no-index " $build_dir /$INPUT_BASE_REF " " $build_dir /$INPUT_HEAD_REF " || true ) "
24
+ output= $( echo " $diff " )
25
25
26
26
# If escaped output is longer than 65000 characters return "output to large to print as a github comment"
27
- if [ ${# escaped_output } -gt 65000 ]; then
28
- escaped_output =" Output is greater than 65000 characters, and therefore too large to print as a github comment."
27
+ if [ ${# output } -gt 65000 ]; then
28
+ output =" Output is greater than 65000 characters, and therefore too large to print as a github comment."
29
29
fi
30
30
31
- echo " diff=$escaped_output " >> " $GITHUB_OUTPUT "
31
+ {
32
+ echo ' diff<<EOF'
33
+ echo " $output "
34
+ echo ' EOF'
35
+ } >> " $GITHUB_OUTPUT "
36
+
32
37
exit 0
You can’t perform that action at this time.
0 commit comments