Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
on: [pull_request]
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

name: Check

Expand All @@ -7,8 +11,11 @@ jobs:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Run tests
run: |
npm ci
Expand Down
32 changes: 32 additions & 0 deletions __tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,38 @@ describe('Parse Parameters', () => {
])
})

test('returns parameters list with an extra equal', async () => {
const json = parseParameters(
'MyParam1=myValue1,MyParam2=myValue2=myValue3,MyParam2=myValue4'
)
expect(json).toEqual([
{
ParameterKey: 'MyParam1',
ParameterValue: 'myValue1'
},
{
ParameterKey: 'MyParam2',
ParameterValue: 'myValue2=myValue3,myValue4'
}
])
})

test('returns parameters list from multiple lists with quotes', async () => {
const json = parseParameters(
'MyParam1=myValue1,MyParam2="myValue2,myValue3",MyParam2=myValue4'
)
expect(json).toEqual([
{
ParameterKey: 'MyParam1',
ParameterValue: 'myValue1'
},
{
ParameterKey: 'MyParam2',
ParameterValue: 'myValue2,myValue3,myValue4'
}
])
})

test('returns parameters list from file', async () => {
const filename = 'file://' + path.join(__dirname, 'params.test.json')
const json = parseParameters(filename)
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inputs:
required: false
default: "CAPABILITY_IAM"
parameter-overrides:
description: 'The parameters to override in the stack inputs. You can pass a comma-delimited list or a file URL. Comma-delimited list has each entry formatted as <ParameterName>=<ParameterValue>. A JSON file can be a local file with a "file://" prefix or remote URL (e.g. file:///${{ github.workspace }}/variables.json or http://example.com/variables.json). A local file needs to be specified with an absolute path to it. The file should look like: [ { "ParameterKey": "KeyPairName", "ParameterValue": "MyKey" }]'
description: 'The parameters to override in the stack inputs. You can pass a comma-delimited list or a file URL. Comma-delimited list has each entry formatted as <ParameterName>=<ParameterValue> or <ParameterName>="<ParameterValue>,<ParameterValue>". A JSON file can be a local file with a "file://" prefix or remote URL (e.g. file:///${{ github.workspace }}/variables.json or http://example.com/variables.json). A local file needs to be specified with an absolute path to it. The file should look like: [ { "ParameterKey": "KeyPairName", "ParameterValue": "MyKey" }]'
required: false
no-execute-changeset:
description: "Indicates whether to execute to the change set or have it reviewed. Default to '0' (will execute the change set)"
Expand Down
14 changes: 12 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading