Skip to content

Commit

Permalink
Merge pull request #13 from tj-actions/feat/add-cdk-pre-installed-input
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 authored Jun 3, 2022
2 parents db0e695 + a87797c commit e08fece
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ inputs:
description: 'AWS CDK stack name to execute.'
default: '*'
required: false
cdk_pre_installed:
description: 'Use the pre installed aws-cdk'
default: false
required: true
cdk_version:
description: 'AWS CDK version to install.'
default: 'latest'
Expand All @@ -28,10 +32,12 @@ runs:
id: aws-cdk
working-directory: ${{ inputs.working_dir }}
run: |
if [[ "${{ inputs.cdk_version }}" == "latest" ]]; then
npm install -g aws-cdk
else
npm install -g "aws-cdk@${{ inputs.cdk_version }}"
if [[ "${{ inputs.cdk_pre_installed }}" == "false" ]]; then
if [[ "${{ inputs.cdk_version }}" == "latest" ]]; then
npm install -g aws-cdk
else
npm install -g "aws-cdk@${{ inputs.cdk_version }}"
fi
fi
cdk ${{ inputs.cdk_subcommand }} ${{ inputs.cdk_extra_args }} "${{ inputs.cdk_stack }}"
Expand Down

0 comments on commit e08fece

Please sign in to comment.