@@ -109,8 +109,8 @@ jobs:
109
109
# Load the Docker image and capture the output
110
110
output=$(docker load -i /tmp/sandbox_image_amd64.tar)
111
111
112
- # Extract the image name from the output
113
- image_name=$(echo "$output" | grep -oP 'Loaded image: \K.*')
112
+ # Extract the first image name from the output
113
+ image_name=$(echo "$output" | grep -oP 'Loaded image: \K.*' | head -n 1 )
114
114
115
115
# Print the full name of the image
116
116
echo "Loaded Docker image: $image_name"
@@ -161,8 +161,8 @@ jobs:
161
161
# Load the Docker image and capture the output
162
162
output=$(docker load -i /tmp/sandbox_image_amd64.tar)
163
163
164
- # Extract the image name from the output
165
- image_name=$(echo "$output" | grep -oP 'Loaded image: \K.*')
164
+ # Extract the first image name from the output
165
+ image_name=$(echo "$output" | grep -oP 'Loaded image: \K.*' | head -n 1 )
166
166
167
167
# Print the full name of the image
168
168
echo "Loaded Docker image: $image_name"
@@ -178,7 +178,7 @@ jobs:
178
178
runs-on : ubuntu-latest
179
179
# don't push if integration tests or sandbox tests fail
180
180
needs : [ghcr_build, integration-tests-on-linux, test-for-sandbox]
181
- if : github.ref == 'refs/heads/main'
181
+ if : github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
182
182
183
183
env :
184
184
tags : ${{ needs.ghcr_build.outputs.tags }}
@@ -212,7 +212,8 @@ jobs:
212
212
- name : Load images and push to registry
213
213
run : |
214
214
mv /tmp/${{ matrix.platform }}/${{ matrix.image }}_image_${{ matrix.platform }}.tar .
215
- loaded_image=$(docker load -i ${{ matrix.image }}_image_${{ matrix.platform }}.tar | grep "Loaded image:" | awk '{print $3}')
215
+ loaded_image=$(docker load -i ${{ matrix.image }}_image_${{ matrix.platform }}.tar | grep "Loaded image:" | head -n 1 | awk '{print $3}')
216
+ echo "loaded image = $loaded_image"
216
217
tags=$(echo ${tags} | tr ' ' '\n')
217
218
image_name=$(echo "ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}" | tr '[:upper:]' '[:lower:]')
218
219
echo "image name = $image_name"
@@ -225,7 +226,7 @@ jobs:
225
226
create_manifest :
226
227
runs-on : ubuntu-latest
227
228
needs : [ghcr_build, ghcr_push]
228
- if : github.ref == 'refs/heads/main'
229
+ if : github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
229
230
230
231
env :
231
232
tags : ${{ needs.ghcr_build.outputs.tags }}
0 commit comments