Skip to content

Commit

Permalink
fix: long wait when the stack doesn't require wating for update in pr…
Browse files Browse the repository at this point in the history
…ogress (#82)
  • Loading branch information
jackton1 authored Nov 28, 2023
1 parent cb93c18 commit ae17f74
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,23 @@ inputs:
runs:
using: 'composite'
steps:
- name: Check stack status
id: check
working-directory: ${{ inputs.working_dir }}
if: inputs.cdk_stack != '*'
run: |
stack_status=$(aws cloudformation describe-stacks --stack-name "${{ inputs.cdk_stack }}" --query 'Stacks[0].StackStatus' --output text) 2>/dev/null || true
echo "Stack status: $stack_status"
echo "stack_status=$stack_status" >> $GITHUB_OUTPUT
shell: bash

- name: Wait for stack update-complete
working-directory: ${{ inputs.working_dir }}
if: steps.check.outputs.stack_status == 'UPDATE_IN_PROGRESS'
run: |
if [[ "${{ inputs.cdk_stack }}" != "*" ]]; then
aws cloudformation wait stack-update-complete --stack-name "${{ inputs.cdk_stack }}" 2>/dev/null || true
fi
echo "Waiting for "${{ inputs.cdk_stack }}" to complete updating..."
aws cloudformation wait stack-update-complete --stack-name "${{ inputs.cdk_stack }}" 2>/dev/null || true
echo "${{ inputs.cdk_stack }} updated"
shell: bash

- name: Run aws-cdk
Expand Down

0 comments on commit ae17f74

Please sign in to comment.