From a3a2046d006fd67ad75d4761f465aa688613f409 Mon Sep 17 00:00:00 2001 From: Grace Rehn Date: Fri, 13 Mar 2026 08:41:34 +1000 Subject: [PATCH 1/4] fix: Colon splitting for custom fields --- __tests__/unit/input-parsing.test.ts | 4 ++++ src/input-parameters.ts | 4 +++- src/test-setup.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/__tests__/unit/input-parsing.test.ts b/__tests__/unit/input-parsing.test.ts index 31c06919..8ed36933 100644 --- a/__tests__/unit/input-parsing.test.ts +++ b/__tests__/unit/input-parsing.test.ts @@ -7,4 +7,8 @@ test('get input parameters', () => { expect(inputParameters.packages).toHaveLength(2) expect(inputParameters.packages).toContain('foo:1.2.3-quux') expect(inputParameters.packages).toContain('bar:4.5.6-xyzzy') + expect(inputParameters.customFields).toEqual({ + key1: 'value', + key2: 'value:with:colons' + }) }) diff --git a/src/input-parameters.ts b/src/input-parameters.ts index 0566e9be..4902028f 100644 --- a/src/input-parameters.ts +++ b/src/input-parameters.ts @@ -35,7 +35,9 @@ export interface InputParameters { const createCustomFields = (inputParameters: string[]): Record => { return inputParameters.reduce( (acc, field) => { - const [key, value] = field.split(':').map(part => part.trim()) + const colonIndex = field.indexOf(':') + const key = field.slice(0, colonIndex).trim() + const value = field.slice(colonIndex + 1).trim() if (key && value) { acc[key] = value } diff --git a/src/test-setup.ts b/src/test-setup.ts index 1b947564..98ded1e6 100644 --- a/src/test-setup.ts +++ b/src/test-setup.ts @@ -9,6 +9,7 @@ process.env = Object.assign(process.env, { INPUT_DEBUG: false, INPUT_DEFAULT_PACKAGE_VERSION: false, INPUT_IGNORE_EXISTING: false, + INPUT_CUSTOM_FIELDS: 'key1:value\key2:value:with:colons', INPUT_PACKAGES: ' foo:1.2.3-quux \n bar:4.5.6-xyzzy \n ', INPUT_PROJECT: 'Projects-7341', INPUT_SERVER: process.env['OCTOPUS_URL'], From d53e8f7dc0bb9e1a5b3161297e339cab72239863 Mon Sep 17 00:00:00 2001 From: Grace Rehn Date: Fri, 13 Mar 2026 08:47:28 +1000 Subject: [PATCH 2/4] fix: typo in tests --- src/test-setup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test-setup.ts b/src/test-setup.ts index 98ded1e6..b6bacea0 100644 --- a/src/test-setup.ts +++ b/src/test-setup.ts @@ -9,7 +9,7 @@ process.env = Object.assign(process.env, { INPUT_DEBUG: false, INPUT_DEFAULT_PACKAGE_VERSION: false, INPUT_IGNORE_EXISTING: false, - INPUT_CUSTOM_FIELDS: 'key1:value\key2:value:with:colons', + INPUT_CUSTOM_FIELDS: 'key1:value \n key2:value:with:colons', INPUT_PACKAGES: ' foo:1.2.3-quux \n bar:4.5.6-xyzzy \n ', INPUT_PROJECT: 'Projects-7341', INPUT_SERVER: process.env['OCTOPUS_URL'], From 3ee57fd933a6740344a351f7f2d5bd67748463ea Mon Sep 17 00:00:00 2001 From: Grace Rehn Date: Fri, 13 Mar 2026 09:57:35 +1000 Subject: [PATCH 3/4] chore: dist for testing --- dist/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index 000de2d0..fd2eaeb6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -67008,7 +67008,9 @@ const EnvironmentVariables = { }; const createCustomFields = (inputParameters) => { return inputParameters.reduce((acc, field) => { - const [key, value] = field.split(':').map(part => part.trim()); + const colonIndex = field.indexOf(':'); + const key = field.slice(0, colonIndex).trim(); + const value = field.slice(colonIndex + 1).trim(); if (key && value) { acc[key] = value; } From 42744c7319d7542b2774254d2b57f7d5c6d52250 Mon Sep 17 00:00:00 2001 From: Grace Rehn Date: Fri, 13 Mar 2026 10:10:56 +1000 Subject: [PATCH 4/4] chore: remove dist after testing --- dist/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index fd2eaeb6..000de2d0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -67008,9 +67008,7 @@ const EnvironmentVariables = { }; const createCustomFields = (inputParameters) => { return inputParameters.reduce((acc, field) => { - const colonIndex = field.indexOf(':'); - const key = field.slice(0, colonIndex).trim(); - const value = field.slice(colonIndex + 1).trim(); + const [key, value] = field.split(':').map(part => part.trim()); if (key && value) { acc[key] = value; }