Skip to content

Commit 604889b

Browse files
committed
chore(ci): enforce partition layer version parity
Log commercial source visibility and fail when Lambda assigns a partition version that differs from the requested commercial version. This prevents applying version-indexed permissions to a misaligned target.
1 parent feb92f7 commit 604889b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/layers_partitions.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,15 @@ jobs:
189189
)
190190
' '${{ matrix.layer }}-${{ matrix.arch }}.policy.json' > /dev/null; then
191191
echo 'public=true' >> "$GITHUB_OUTPUT"
192+
echo 'Commercial source layer is public'
192193
else
193194
RESULT=$?
194195
if (( RESULT > 1 )); then
195196
echo "Unable to evaluate source layer policy (jq exit ${RESULT})"
196197
exit 1
197198
fi
198199
echo 'public=false' >> "$GITHUB_OUTPUT"
200+
echo 'Commercial source layer is private'
199201
fi
200202
- id: transform
201203
run: |
@@ -229,6 +231,7 @@ jobs:
229231
id: create-layer
230232
env:
231233
SOURCE_IS_PUBLIC: ${{ steps.source_policy.outputs.public }}
234+
VERSION: ${{ inputs.version }}
232235
run: |
233236
jq '{"LayerName": "${{ matrix.layer }}-${{ matrix.arch }}", "Description": .Description, "CompatibleRuntimes": .CompatibleRuntimes, "CompatibleArchitectures": .CompatibleArchitectures, "LicenseInfo": .LicenseInfo} | with_entries(select(.value != null))' '${{ matrix.layer }}-${{ matrix.arch }}.json' > input.json
234237
@@ -238,6 +241,11 @@ jobs:
238241
--query 'Version' \
239242
--output text)
240243
244+
if (( LAYER_VERSION != VERSION )); then
245+
echo "Expected to publish as version ${VERSION}, received ${LAYER_VERSION}"
246+
exit 1
247+
fi
248+
241249
echo "LAYER_VERSION=$LAYER_VERSION" >> "$GITHUB_OUTPUT"
242250
243251
if [[ "$SOURCE_IS_PUBLIC" == "true" ]]; then

0 commit comments

Comments
 (0)