Skip to content

Commit 7d822c4

Browse files
committed
chore: write diffs
1 parent 9709466 commit 7d822c4

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/comment-diffs.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,16 +178,27 @@ jobs:
178178
echo "No diff"
179179
else
180180
# Push the branches
181-
git push --set-upstream origin diffs
181+
# git push --set-upstream origin diffs
182182
183183
# Get new version remote commit hash
184-
new_version_commit_hash=$(git rev-parse --short origin/diffs)
184+
# new_version_commit_hash=$(git rev-parse --short origin/diffs)
185185
186186
# Get old version remote commit hash
187-
old_version_commit_hash=$(git rev-parse --short origin/diffs~)
187+
# old_version_commit_hash=$(git rev-parse --short origin/diffs~)
188188
189189
# Add output to file
190-
echo "[$library_type/$language](https://github.com/${{github.repository}}/compare/$old_version_commit_hash..$new_version_commit_hash)" >> "$output_file"
190+
# echo "[$library_type/$language](https://github.com/${{github.repository}}/compare/$old_version_commit_hash..$new_version_commit_hash)" >> "$output_file"
191+
192+
193+
# Add type to output file
194+
message="""<details>
195+
<summary>${library_type}/${language}</summary>"""
196+
echo """${message}""" >> $output_file
197+
198+
# Add changes to output file
199+
git diff HEAD~ >> $output_file
200+
201+
echo "</details>" >> $output_file
191202

192203
# Add empty line
193204
echo \ >> $output_file
@@ -203,6 +214,7 @@ jobs:
203214
done
204215

205216
if [ -s "$output_file" ]; then
217+
cat $output_file
206218
echo "DIFF_IS_NON_EMPTY=1" >> $GITHUB_OUTPUT
207219
else
208220
echo "DIFF_IS_NON_EMPTY=0" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)