Skip to content

Commit 6e8adf7

Browse files
committed
test2
Signed-off-by: ZePan110 <ze.pan@intel.com>
1 parent d235f6e commit 6e8adf7

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ jobs:
3737
git fetch origin ${{ github.base_ref }}
3838
merged_commit=$(git log -1 --format='%H')
3939
files=$(git diff --name-status --diff-filter=ARM ${{ github.event.pull_request.base.sha }} ${merged_commit} | awk '{print $2}' | grep -E 'Dockerfile$' || true)
40-
echo "changed_files=$files"
4140
echo "files<<EOF" >> $GITHUB_OUTPUT
4241
echo "$files" >> $GITHUB_OUTPUT
4342
echo "EOF" >> $GITHUB_OUTPUT
@@ -54,12 +53,12 @@ jobs:
5453
image_pr="pr-image-size-pr:$(echo $dir | tr '/' '-')"
5554
cd $dir
5655
echo "Building base image for $dockerfile"
57-
git checkout origin/${{ github.base_ref }} -- "$dockerfile"
56+
git checkout origin/${{ github.base_ref }}
5857
docker build -f "$dockerfile" -t "$image_base" --no-cache .
5958
size_base=$(docker image inspect "$image_base" | jq '.[0].Size / (1024 * 1024) | round')
6059
6160
echo "Building PR image for $dockerfile"
62-
git checkout -- "$dockerfile" # restore PR version
61+
git checkout ${{ github.event.pull_request.base.sha }}
6362
docker build -f "$dockerfile" -t "$image_pr" --no-cache .
6463
size_pr=$(docker image inspect "$image_pr" | jq '.[0].Size / (1024 * 1024) | round')
6564

0 commit comments

Comments
 (0)