Skip to content

Commit 1d58eff

Browse files
committed
Added step to show k8s diffs.
1 parent 513972b commit 1d58eff

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/helm-tests.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,37 @@ jobs:
8383
-f ./eoapi/test-k3s-unittest-values.yaml \
8484
./eoapi
8585
86+
- name: Show helm template differences
87+
if: github.event_name == 'pull_request'
88+
run: |
89+
cd helm-chart
90+
# Get base branch
91+
BASE_BRANCH=${{ github.base_ref }}
92+
# Fetch base branch
93+
git fetch origin $BASE_BRANCH
94+
# Checkout base branch temporarily
95+
git checkout origin/$BASE_BRANCH
96+
# Build dependencies for base branch
97+
helm dependency build eoapi
98+
# Generate template for base branch
99+
helm template eoapi-base \
100+
-f ./eoapi/values.yaml \
101+
-f ./eoapi/test-k3s-unittest-values.yaml \
102+
./eoapi > base_template.yaml
103+
# Checkout back to PR branch
104+
git checkout -
105+
# Build dependencies for PR branch
106+
helm dependency build eoapi
107+
# Generate template for PR branch
108+
helm template eoapi-pr \
109+
-f ./eoapi/values.yaml \
110+
-f ./eoapi/test-k3s-unittest-values.yaml \
111+
./eoapi > pr_template.yaml
112+
# Show differences
113+
echo "=== Helm Template Differences (Base vs PR) ==="
114+
diff -u base_template.yaml pr_template.yaml || true
115+
echo "=== End Helm Template Differences ==="
116+
86117
- name: helm render and install eoapi templates
87118
run: |
88119
export GITSHA='${{github.sha}}'

0 commit comments

Comments
 (0)