Skip to content

Commit aedf988

Browse files
add diff to gh action size (#20889)
* Diff dev assets * Add diff to size action * Fix diff * Fix diff * Update size * Demo * hm * hm * hm * hm * hm * hm * hm * hm * Revert "Demo" This reverts commit c520b6f.
1 parent cf2227a commit aedf988

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/size-comment.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ jobs:
8989
done <<< $(cat out.txt)
9090
echo 'EOF' >> $GITHUB_OUTPUT
9191
92+
- name: "[Dev] calculate diff"
93+
run: |
94+
# diff exits with status 1 if there is a diff
95+
diff -u main/out.txt ${{ steps.find-pr-txt.outputs.txtPath }} > dev-diff.txt || echo "Differences exist"
96+
cat dev-diff.txt
97+
98+
- name: "[Dev] store diff in GITHUB_OUTPUT"
99+
id: dev-diff
100+
run: |
101+
echo 'diffText<<EOF' >> $GITHUB_OUTPUT
102+
while IFS= read -r line; do
103+
echo "$line" >> $GITHUB_OUTPUT
104+
done <<< $(cat ./dev-diff.txt)
105+
echo 'EOF' >> $GITHUB_OUTPUT
106+
107+
92108
93109
- name: "[Debug] collected data from artifacts"
94110
run: |
@@ -101,6 +117,10 @@ jobs:
101117
echo "PR out.txt"
102118
echo -e "${{ steps.dev.outputs.sizes }}"
103119
120+
echo "Dev diff"
121+
echo -e "${{ steps.dev-diff.outputs.diffText }}"
122+
123+
104124
#########################
105125
# Intended Layout:
106126
#
@@ -117,6 +137,16 @@ jobs:
117137
with:
118138
issue: ${{ steps.find-pr-number.outputs.prNumber }}
119139
message: |
140+
<details><summary>Development Assets</summary>
141+
142+
Diff
143+
144+
```diff
145+
${{ steps.dev-diff.outputs.diffText }}
146+
```
147+
148+
Details
149+
120150
<table><thead><tr><th></th><th>This PR</th><th>main</th></tr></thead>
121151
<tbody>
122152
<tr><td>Dev</td><td>
@@ -133,6 +163,7 @@ jobs:
133163
134164
</td></tr>
135165
</tbody></table>
166+
</details>
136167
137168
138169

0 commit comments

Comments
 (0)