Skip to content

Commit 69a5ad2

Browse files
Merge pull request #523 from element-hq/gaelg/dyff-truncate-added
Dyff comment : truncate added files
2 parents b2c80b5 + eb51181 commit 69a5ad2

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

.github/workflows/build-test.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ jobs:
110110

111111
# helm template doesn't reliably order manifests within the same kind, so use yq to do it for us
112112
- name: Generate manifests for PR
113+
id: generate-manifests
113114
run: |
114115
mkdir -p "$RUNNER_TEMP/new"
115116
for values in charts/matrix-stack/ci/*values.yaml; do
@@ -122,6 +123,7 @@ jobs:
122123
yq ea '[.] | .[] | splitDoc' | \
123124
yq -s "\"$RUNNER_TEMP/new/$(basename "$values" ".yaml")/\""' + ([.kind, .metadata.name] | join("-") | downcase) + ".yaml"'
124125
done
126+
echo "output_dir=$RUNNER_TEMP/new" | tee -a "$GITHUB_OUTPUT"
125127
126128
# We want the most recent common ancestor between the target & PR branches rather than the target branch itself
127129
# There could have been more commits to the target branch since the PR branch was created and we don't want to see
@@ -156,9 +158,19 @@ jobs:
156158
tool_versions: |
157159
dyff 1.10.1
158160
161+
- name: Upload new manifests
162+
id: upload-new
163+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
164+
with:
165+
name: new-manifests
166+
path: ${{ steps.generate-manifests.outputs.output_dir }}
167+
retention-days: 1
168+
159169
- name: dyff old and new manifests
160170
id: dyff
161171
shell: bash
172+
env:
173+
ARTIFACT_URL: ${{ steps.upload-new.outputs.artifact-url }}
162174
run: |
163175
echo "output_dir=$RUNNER_TEMP" | tee -a "$GITHUB_OUTPUT"
164176
values_directories=$(find "$RUNNER_TEMP/old" "$RUNNER_TEMP/new" -maxdepth 1 -type d | sed -E 's|'"$RUNNER_TEMP"'/(old\|new)||' | sed -E 's|^/||' | sort | uniq)
@@ -182,8 +194,9 @@ jobs:
182194
file_content=$(sed -e 's/^/+ /' < "$RUNNER_TEMP/new/$templates_file")
183195
comment_templates_body+="<details><summary>$current_file (added)</summary>\n"
184196
comment_templates_body+='\n```diff\n'
185-
comment_templates_body+=$file_content
186-
comment_templates_body+='\n```\n</details>\n\n'
197+
comment_templates_body+="# The full content of the file is available in ${ARTIFACT_URL}\n"
198+
comment_templates_body+=$(head -n 5 <<< "$file_content")
199+
comment_templates_body+='\n...\n```\n</details>\n\n'
187200
continue
188201
fi
189202

newsfragments/523.internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CI: Truncate added files in dyff comment.

0 commit comments

Comments
 (0)