Skip to content

Commit 13c7c1f

Browse files
committed
Support comma delimited lists for parameter overrides
1 parent 87a972c commit 13c7c1f

File tree

5 files changed

+2954
-1535
lines changed

5 files changed

+2954
-1535
lines changed

__tests__/utils.test.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,38 @@ describe('Parse Parameters', () => {
7272
])
7373
})
7474

75+
test('returns parameters list with an extra equal', async () => {
76+
const json = parseParameters(
77+
'MyParam1=myValue1,MyParam2=myValue2=myValue3,MyParam2=myValue4'
78+
)
79+
expect(json).toEqual([
80+
{
81+
ParameterKey: 'MyParam1',
82+
ParameterValue: 'myValue1'
83+
},
84+
{
85+
ParameterKey: 'MyParam2',
86+
ParameterValue: 'myValue2=myValue3,myValue4'
87+
}
88+
])
89+
})
90+
91+
test('returns parameters list from multiple lists with quotes', async () => {
92+
const json = parseParameters(
93+
'MyParam1=myValue1,MyParam2="myValue2,myValue3",MyParam2=myValue4'
94+
)
95+
expect(json).toEqual([
96+
{
97+
ParameterKey: 'MyParam1',
98+
ParameterValue: 'myValue1'
99+
},
100+
{
101+
ParameterKey: 'MyParam2',
102+
ParameterValue: 'myValue2,myValue3,myValue4'
103+
}
104+
])
105+
})
106+
75107
test('returns parameters list from file', async () => {
76108
const filename = 'file://' + path.join(__dirname, 'params.test.json')
77109
const json = parseParameters(filename)

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ inputs:
1515
required: false
1616
default: "CAPABILITY_IAM"
1717
parameter-overrides:
18-
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" }]'
18+
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" }]'
1919
required: false
2020
no-execute-changeset:
2121
description: "Indicates whether to execute to the change set or have it reviewed. Default to '0' (will execute the change set)"

0 commit comments

Comments
 (0)