Add docker images size change check#2133
Conversation
Signed-off-by: ZePan110 <ze.pan@intel.com>
Dependency Review✅ No vulnerabilities or license issues found.Scanned Files
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a GitHub Actions workflow that detects changes to Dockerfiles in pull requests, builds both the base and PR versions of each image, and reports size differences.
- Identifies changed Dockerfiles in the PR.
- Builds images from the base branch and PR branch.
- Outputs byte-level size changes for each Dockerfile.
Comments suppressed due to low confidence (2)
.github/workflows/pr-image-size.yml:34
- In case of renamed Dockerfiles,
git diff --name-statusoutputs both old and new paths (old in $2, new in $3). Currently you're always picking $2, which will miss the new filename on renames. Consider checking the status code and using $3 for 'R' entries.
files=$(git diff --name-status --diff-filter=ARM ${{ github.event.pull_request.base.sha }} ${merged_commit} | awk '{print $2}' | grep -E 'Dockerfile$' || true)
.github/workflows/pr-image-size.yml:50
- Only checking out the Dockerfile from the base branch means the build context still includes PR changes to other files, which may lead to incorrect size comparisons. It would be more accurate to checkout the entire directory (or full repo) at the base commit before building.
git checkout origin/${{ github.base_ref }} -- "$dockerfile"
…ain permissions Signed-off-by: ZePan110 <ze.pan@intel.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
33bd367 to
f136981
Compare
a18efb7 to
2e4bd03
Compare
|
ℹ️ INFO |
Please remove |
Maybe shows a warning like this: |
Signed-off-by: ZePan110 <ze.pan@intel.com>
|
ℹ️ just test comment |
Signed-off-by: ZePan110 <ze.pan@intel.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
Description
Add docker images size change check
Issues
opea-project/GenAIComps#1783
Type of change
List the type of change like below. Please delete options that are not relevant.
Dependencies
List the newly introduced 3rd party dependency if exists.
Tests
Test pssed:

https://github.com/opea-project/GenAIExamples/actions/runs/16362800522
#2133 (comment)