Skip to content

Commit 5b6b6bf

Browse files
committed
Test comment
Signed-off-by: ZePan110 <ze.pan@intel.com>
1 parent 686d950 commit 5b6b6bf

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/pr-image-size.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,20 @@ jobs:
7373
size_pr=$(docker image inspect "$image_pr" | jq '.[0].Size / (1024 * 1024) | round')
7474
7575
diff=$((size_pr - size_base))
76-
echo "::warning::Image size change: $size_base -> $size_pr MB' (diff: $diff MB)"
77-
echo "File $dockerfile resulted in a change in the image size from $size_base -> $size_pr MB" >> $GITHUB_STEP_SUMMARY
76+
# echo "::warning::Image size change: $size_base -> $size_pr MB' (diff: $diff MB)"
77+
echo "comment to ${{ github.event.pull_request.number }}"
78+
if [ "$diff" -gt 50 ]; then
79+
curl -X POST \
80+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
81+
-H "Accept: application/vnd.github.v3+json" \
82+
"https://github.com/opea-project/GenAIExamples/${{ github.event.pull_request.number }}/comments" \
83+
-d '{"body":"⚠️ File $dockerfile resulted in a change in the image size from $size_base -> $size_pr MB"}'
84+
else
85+
curl -X POST \
86+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
87+
-H "Accept: application/vnd.github.v3+json" \
88+
"https://github.com/opea-project/GenAIExamples/${{ github.event.pull_request.number }}/comments" \
89+
-d '{"body":"File $dockerfile resulted in a change in the image size from $size_base -> $size_pr MB"}'
90+
# echo "File $dockerfile resulted in a change in the image size from $size_base -> $size_pr MB" >> $GITHUB_STEP_SUMMARY
7891
docker rmi "$image_base" "$image_pr"
7992
done < <(echo "${{ steps.changed-dockerfiles.outputs.files }}" | tr '\n' '\0')

0 commit comments

Comments
 (0)