diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 96eadae..f7f604a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,19 +14,13 @@ jobs: name: Test aws-cdk steps: - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + uses: actions/checkout@v4 - name: Setup go uses: actions/setup-go@v5 with: - go-version: '1.17.5' - - - uses: actions/cache@v4 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + go-version-file: 'test/go.mod' + cache-dependency-path: 'test/go.sum' - name: Install dependencies run: go install diff --git a/action.yml b/action.yml index 1b2c38c..fde45ef 100644 --- a/action.yml +++ b/action.yml @@ -29,18 +29,25 @@ runs: 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 + # Original stack name + CDK_STACK="${{ inputs.cdk_stack }}" + + # Replace '/' with '-' in the stack name + MODIFIED_STACK_NAME="${CDK_STACK//\//-}" + + stack_status=$(aws cloudformation describe-stacks --stack-name "$MODIFIED_STACK_NAME" --query 'Stacks[0].StackStatus' --output text) 2>/dev/null || true echo "Stack status: $stack_status" echo "stack_status=$stack_status" >> $GITHUB_OUTPUT + echo "stack_name=$MODIFIED_STACK_NAME" >> $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: | - 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" + echo "Waiting for "${{ steps.check.outputs.stack_name }}" to complete updating..." + aws cloudformation wait stack-update-complete --stack-name "${{ steps.check.outputs.stack_name }}" 2>/dev/null || true + echo "${{ steps.check.outputs.stack_name }} update complete" shell: bash - name: Run aws-cdk