Skip to content

Commit f2dcf2c

Browse files
committed
Use successful retrieval
1 parent 13ae355 commit f2dcf2c

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

.github/workflows/develop.yaml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -463,36 +463,33 @@ jobs:
463463
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
464464
aws-region: us-east-1
465465

466-
- name: Test stack creation that fails to retrieve stack ID
467-
id: create-failing-stack
466+
- name: Test stack creation with ID retrieval
467+
id: create-stack
468468
uses: aws-actions/aws-cloudformation-github-deploy@v2.0.0-beta
469469
with:
470-
name: test-failing-stack-id-${{ github.run_number }}
471-
template: failing-stack.yaml
472-
parameter-overrides: "Environment=test"
473-
continue-on-error: true
470+
name: test-stack-id-${{ github.run_number }}
471+
template: stack.yaml
472+
parameter-overrides: "Environment=beta"
474473

475-
- name: Verify stack ID retrieval on failure
474+
- name: Verify stack ID retrieval
476475
run: |
477-
STACK_ID="${{ steps.create-failing-stack.outputs.stack-id }}"
476+
STACK_ID="${{ steps.create-stack.outputs.stack-id }}"
478477
echo "Stack ID: $STACK_ID"
479-
echo "Deployment outcome: ${{ steps.create-failing-stack.outcome }}"
478+
echo "Deployment outcome: ${{ steps.create-stack.outcome }}"
480479
481-
# For failed deployments, we should get a stack ID (ARN) for debugging
482-
if [[ "${{ steps.create-failing-stack.outcome }}" == "failure" ]]; then
483-
if [[ $STACK_ID == arn:aws:cloudformation:* ]]; then
484-
echo "✅ Stack ID retrieved successfully for failed deployment"
485-
# Verify we can access the failed stack for debugging
486-
aws cloudformation describe-stacks --stack-name "$STACK_ID"
487-
echo "✅ Failed stack is accessible for debugging"
488-
else
489-
echo "❌ Expected stack ARN for failed deployment, got: $STACK_ID"
490-
exit 1
491-
fi
480+
# Should get either ARN or stack name for successful deployment
481+
if [[ $STACK_ID == arn:aws:cloudformation:* ]]; then
482+
echo "✅ Got stack ARN: $STACK_ID"
483+
elif [[ "$STACK_ID" == "test-stack-id-${{ github.run_number }}" ]]; then
484+
echo "✅ Got stack name: $STACK_ID"
492485
else
493-
echo "❌ Expected deployment to fail for this test"
486+
echo "❌ Unexpected stack ID: $STACK_ID (expected ARN or stack name)"
494487
exit 1
495488
fi
489+
490+
# Verify we can access the stack
491+
aws cloudformation describe-stacks --stack-name "$STACK_ID"
492+
echo "✅ Stack is accessible"
496493
497494
test-execute-only-with-events:
498495
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)