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