Skip to content

Commit e9e85a0

Browse files
committed
chore: more fixes
1 parent d1757bd commit e9e85a0

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/wc-build-push.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ jobs:
7272
cache-from: ${{ inputs.enable-cache && format('type=gha,scope={0}-{1}-{2}', github.repository, inputs.flavor, matrix.runner) || '' }}
7373
- name: Export digest
7474
run: |
75+
set -Eeuo pipefail
7576
mkdir -p ${{ runner.temp }}/digests
76-
digest="${{ steps.build-and-push.outputs.digest }}"
77-
touch "${{ runner.temp }}/digests/${digest#sha256:}"
77+
touch "${{ runner.temp }}/digests/${DIGEST#sha256:}"
78+
env:
79+
DIGEST: ${{ steps.build-and-push.outputs.digest }}
7880
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
7981
with:
8082
name: digests-${{ inputs.flavor }}-${{ steps.devcontainer-arch.outputs.arch }}
@@ -128,15 +130,13 @@ jobs:
128130
type=semver,pattern={{major}}.{{minor}}
129131
type=semver,pattern={{major}}
130132
- name: Create manifest list and push
131-
working-directory: ${{ runner.temp }}/digests
132-
shell: python
133133
run: |
134134
import os
135135
import json
136136
import subprocess
137137
138-
CONTAINER = '${{ env.REGISTRY }}/${{ github.repository }}-${{ inputs.flavor }}'
139-
METADATA = json.loads('${{ steps.metadata.outputs.json }}')
138+
CONTAINER = f"{os.getenv('REGISTRY')}/${{ github.repository }}-{os.getenv('CONTAINER_FLAVOR')}"'
139+
METADATA = json.loads('${METADATA_JSON}')
140140
141141
digests = [f for f in os.listdir('.') if f.startswith('sha256:') or len(f) == 64]
142142
@@ -148,12 +148,18 @@ jobs:
148148
149149
print(' '.join(command))
150150
subprocess.run(command, check=True)
151+
env:
152+
METADATA_JSON: ${{ steps.metadata.outputs.json }}
153+
shell: python
154+
working-directory: ${{ runner.temp }}/digests
151155
- name: Inspect manifest and extract digest
152156
id: inspect-manifest
153157
run: |
154158
set -Eeuo pipefail
155-
output=$(docker buildx imagetools inspect "${REGISTRY}/${{ github.repository }}-${CONTAINER_FLAVOR}:${{ steps.metadata.outputs.version }}" --format '{{json .}}')
159+
output=$(docker buildx imagetools inspect "${REGISTRY}/${{ github.repository }}-${CONTAINER_FLAVOR}:${CONTAINER_VERSION}" --format '{{json .}}')
156160
echo "digest=$(echo "$output" | jq -r '.manifest.digest // .manifests[0].digest')" >> "$GITHUB_OUTPUT"
161+
env:
162+
CONTAINER_VERSION: ${{ steps.metadata.outputs.version }}
157163
- uses: ./.github/actions/container-size-diff
158164
id: container-size-diff
159165
with:

0 commit comments

Comments
 (0)