Add docker_logs to control docker build summaries upload and set #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Get Image Platforms | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| image: | ||
| description: 'Image name to inspect' | ||
| required: true | ||
| type: string | ||
| outputs: | ||
| platforms: | ||
| description: 'Comma-separated list of platforms (e.g. linux/amd64,linux/arm64)' | ||
| value: ${{ jobs.dm-inspect.outputs.platforms }} | ||
| build-matrix: | ||
| description: 'JSON list of platforms for matrix usage' | ||
| value: ${{ jobs.dm-inspect.outputs.build-matrix }} | ||
| jobs: | ||
| dm-inspect: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| platforms: ${{ steps.get-platforms.outputs.platforms }} | ||
| build-matrix: ${{ steps.get-platforms.outputs.build-matrix }} | ||
| steps: | ||
| - name: Get Image Platforms | ||
| id: get-platforms | ||
| shell: bash -o pipefail {0} | ||
| run: | | ||
| PLATFORMS="$(docker manifest inspect ${{ inputs.image }} | \ | ||
| jq -r '.manifests[] | "\(.platform.os)/\(.platform.architecture)\(if .platform.variant != null then "/\(.platform.variant)" else "" end)"' | \ | ||
| sort -u | grep -v unknown | paste -sd ',')" | ||
| if [ ! -n "${PLATFORMS}" ] | ||
| then | ||
| echo "Cannot get list of platforms supported by the ${{ inputs.image }}." >&2 | ||
| exit 1 | ||
| fi | ||
| BUILD_MATRIX="$(echo ${PLATFORMS} | tr ',' '\n' | jq -R . | jq -s . | tr '\n' ' ')" | ||
| echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT | ||
| echo "build-matrix=${BUILD_MATRIX}" >> $GITHUB_OUTPUT | ||
| shell: bash | ||