Skip to content

Commit 42a8718

Browse files
rodrigokdougfabris
authored andcommitted
Fix CI for external PRs
1 parent ffcfb75 commit 42a8718

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

.github/actions/build-docker/action.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,24 @@ runs:
119119
echo "Contents of /tmp/meta.json:"
120120
cat /tmp/meta.json
121121
122-
SERVICE_SUFFIX=${{ inputs.service == 'rocketchat' && inputs.type == 'coverage' && (github.event_name == 'release' || github.ref == 'refs/heads/develop') && '-cov' || '' }}
122+
if [[ "${{ inputs.publish-image }}" == 'true' ]]; then
123+
SERVICE_SUFFIX=${{ inputs.service == 'rocketchat' && inputs.type == 'coverage' && (github.event_name == 'release' || github.ref == 'refs/heads/develop') && '-cov' || '' }}
123124
124-
mkdir -p /tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}
125+
mkdir -p /tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}
125126
126-
# Get digest and image info
127-
DIGEST=$(jq -r '.["${{ inputs.service }}"].["containerimage.digest"]' "/tmp/meta.json")
128-
IMAGE_NO_TAG=$(echo "$IMAGE" | sed 's/:.*$//')
129-
FULL_IMAGE="${IMAGE_NO_TAG}@${DIGEST}"
127+
# Get digest and image info
128+
DIGEST=$(jq -r '.["${{ inputs.service }}"].["containerimage.digest"]' "/tmp/meta.json")
129+
IMAGE_NO_TAG=$(echo "$IMAGE" | sed 's/:.*$//')
130+
FULL_IMAGE="${IMAGE_NO_TAG}@${DIGEST}"
130131
131-
echo "Inspecting image: $FULL_IMAGE"
132+
echo "Inspecting image: $FULL_IMAGE"
132133
133-
# Inspect the image and save complete manifest with sizes (using -v for verbose)
134-
docker manifest inspect -v "$FULL_IMAGE" > "/tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}/manifest.json"
134+
# Inspect the image and save complete manifest with sizes (using -v for verbose)
135+
docker manifest inspect -v "$FULL_IMAGE" > "/tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}/manifest.json"
135136
136-
echo "Saved manifest to /tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}/manifest.json"
137-
cat "/tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}/manifest.json" | jq '.'
137+
echo "Saved manifest to /tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}/manifest.json"
138+
cat "/tmp/manifests/${{ inputs.service }}${SERVICE_SUFFIX}/${{ inputs.arch }}/manifest.json" | jq '.'
139+
fi
138140
139141
- uses: actions/upload-artifact@v4
140142
if: inputs.publish-image == 'true'

0 commit comments

Comments
 (0)