Skip to content

Commit 1434590

Browse files
authored
Merge pull request #436 from element-hq/bbz/improve-dyff-handling
Improve dyff handling
2 parents 25e2a1a + 7388290 commit 1434590

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

.github/workflows/build-test.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ jobs:
148148
run: |
149149
templates_files=$(find /tmp/old /tmp/new -maxdepth 1 -name '*values.yaml' | sed -E 's|/tmp/(old\|new)/||' | sort | uniq)
150150
151+
header="# dyff of changes in rendered templates of CI manifests\n\n"
151152
comment_body=""
152153
while read -r templates_file; do
153154
if [ ! -f "/tmp/old/$templates_file" ]; then
@@ -171,16 +172,13 @@ jobs:
171172
done <<< "$templates_files"
172173
173174
if [ -z "$comment_body" ]; then
174-
echo "changes=no" >> "$GITHUB_OUTPUT"
175175
comment_body="No changes in rendered templates"
176-
else
177-
echo "changes=yes" >> "$GITHUB_OUTPUT"
178176
fi
179177
180-
echo "$comment_body"
181-
{ echo 'body<<EOF'; echo -e "$comment_body"; echo 'EOF'; } >> "$GITHUB_OUTPUT"
178+
echo -e "$header$comment_body" | tee "/tmp/dyff-output"
182179
183180
- name: Find dyff comment
181+
if: github.event.pull_request.number != ''
184182
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3
185183
id: find-dyff-comment
186184
with:
@@ -189,12 +187,10 @@ jobs:
189187
body-includes: 'dyff of changes in rendered templates'
190188

191189
- name: Create or update comment
190+
if: github.event.pull_request.number != ''
192191
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4
193192
with:
194193
comment-id: ${{ steps.find-dyff-comment.outputs.comment-id }}
195194
issue-number: ${{ github.event.pull_request.number }}
196-
body: |
197-
# dyff of changes in rendered templates of CI manifests
198-
199-
${{ steps.dyff.outputs.body }}
195+
body-path: /tmp/dyff-output
200196
edit-mode: replace
File renamed without changes.

0 commit comments

Comments
 (0)