Skip to content

Commit a2160ea

Browse files
authored
Fix: [AEA-0000] - fix no initial tag for cdk (#1579)
## Summary - Routine Change ### Details - fix no initial tag for cdk
1 parent f8303f1 commit a2160ea

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/cdk_release_code.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,19 @@ jobs:
104104
- name: fix cdk.json for diff - existing tag
105105
if: ${{ inputs.DEPLOY_CDK_CODE == false }}
106106
run: |
107-
VERSION_NUMBER=$(aws cloudformation describe-stacks --stack-name "$STACK_NAME" --query "Stacks[0].Tags[?Key=='version'].Value" --output text)
108-
COMMIT_ID=$(aws cloudformation describe-stacks --stack-name "$STACK_NAME" --query "Stacks[0].Tags[?Key=='commit'].Value" --output text)
109-
if [ "${VERSION_NUMBER}" == "" ]; then
110-
echo "Can not find target tag. Using initial tag in repo"
111-
export VERSION_NUMBER="v1.0.4-alpha"
107+
if aws cloudformation describe-stacks --stack-name "$STACK_NAME" >/dev/null 2>&1; then
108+
VERSION_NUMBER=$(aws cloudformation describe-stacks \
109+
--stack-name "$STACK_NAME" \
110+
--query "Stacks[0].Tags[?Key=='version'].Value" \
111+
--output text)
112+
COMMIT_ID=$(aws cloudformation describe-stacks \
113+
--stack-name "$STACK_NAME" \
114+
--query "Stacks[0].Tags[?Key=='commit'].Value" \
115+
--output text)
116+
else
117+
echo "Initial deployment. Using unknown tag"
118+
VERSION_NUMBER="unknown"
119+
COMMIT_ID="unknown"
112120
fi
113121
VERSION_NUMBER="${VERSION_NUMBER}" \
114122
COMMIT_ID="${COMMIT_ID}" \

0 commit comments

Comments
 (0)