File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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')
You can’t perform that action at this time.
0 commit comments