diff --git a/__tests__/unit/input-parsing.test.ts b/__tests__/unit/input-parsing.test.ts index 09f4e933..940f18b6 100644 --- a/__tests__/unit/input-parsing.test.ts +++ b/__tests__/unit/input-parsing.test.ts @@ -9,6 +9,6 @@ test('get input parameters', () => { expect(inputParameters.tenants[0]).toBe('Tenant A') expect(inputParameters.tenants[1]).toBe('Tenant B') expect(inputParameters.variables).toBeDefined() - expect(inputParameters.variables?.get('foo')).toBe('quux') - expect(inputParameters.variables?.get('bar')).toBe('xyzzy') + expect(inputParameters.variables?.['foo']).toBe('quux') + expect(inputParameters.variables?.['bar']).toBe('xyzzy') }) diff --git a/package-lock.json b/package-lock.json index a3adbda6..a6cc4645 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@actions/core": "^1.10.0", - "@octopusdeploy/api-client": "^2.1.1" + "@octopusdeploy/api-client": "^2.1.4" }, "devDependencies": { "@octopusdeploy/runtime-inputs": "^0.16.0", @@ -1238,17 +1238,16 @@ } }, "node_modules/@octopusdeploy/api-client": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@octopusdeploy/api-client/-/api-client-2.1.1.tgz", - "integrity": "sha512-4ZjWt/tdN8wRl2OG2rjp+AtdA6dIYGYv/CrgTISOWsUB5XybpKhP/BNhV2H5GDMzt/LwkZGa727kBJA8CFr74A==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@octopusdeploy/api-client/-/api-client-2.1.4.tgz", + "integrity": "sha512-ySaVkFouE4sfDpcjJyTBVnPE4BZ6540hH8glfTydzp1B+jjA5q6kIDbk+fu35h2ZRcOu0hAKfIPcLlntpqSnFg==", "dependencies": { "adm-zip": "^0.5.9", - "axios": "^0.27.2", + "axios": "^1.2.1", "form-data": "^4.0.0", "glob": "^8.0.3", - "hpagent": "^1.0.0", "lodash": "^4.17.21", - "semver": "^7.3.7", + "semver": "^7.3.8", "urijs": "^1.19.11" } }, @@ -1761,9 +1760,9 @@ } }, "node_modules/adm-zip": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.9.tgz", - "integrity": "sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg==", + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz", + "integrity": "sha512-x0HvcHqVJNTPk/Bw8JbLWlWoo6Wwnsug0fnYYro1HBrjxZ3G7/AZk7Ahv8JwDe1uIcz8eBqvu86FuF1POiG7vQ==", "engines": { "node": ">=6.0" } @@ -1934,12 +1933,13 @@ } }, "node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.2.2.tgz", + "integrity": "sha512-bz/J4gS2S3I7mpN/YZfGFTqhXTYzRho8Ay38w2otuuDR322KzFIWm/4W2K6gIwvWaws5n+mnb7D1lN9uD+QH6Q==", "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, "node_modules/axobject-query": { @@ -3382,9 +3382,9 @@ } }, "node_modules/glob/node_modules/minimatch": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", - "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg==", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -3508,14 +3508,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/hpagent": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/hpagent/-/hpagent-1.2.0.tgz", - "integrity": "sha512-A91dYTeIB6NoXG+PxTQpCCDDnfHsW9kc06Lvpu1TEe9gnd6ZFeiBoRO9JvzEv6xK7EX97/dUE8g/vBMTqTS3CA==", - "engines": { - "node": ">=14" - } - }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -5296,6 +5288,11 @@ "node": ">= 6" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -7154,17 +7151,16 @@ } }, "@octopusdeploy/api-client": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@octopusdeploy/api-client/-/api-client-2.1.1.tgz", - "integrity": "sha512-4ZjWt/tdN8wRl2OG2rjp+AtdA6dIYGYv/CrgTISOWsUB5XybpKhP/BNhV2H5GDMzt/LwkZGa727kBJA8CFr74A==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@octopusdeploy/api-client/-/api-client-2.1.4.tgz", + "integrity": "sha512-ySaVkFouE4sfDpcjJyTBVnPE4BZ6540hH8glfTydzp1B+jjA5q6kIDbk+fu35h2ZRcOu0hAKfIPcLlntpqSnFg==", "requires": { "adm-zip": "^0.5.9", - "axios": "^0.27.2", + "axios": "^1.2.1", "form-data": "^4.0.0", "glob": "^8.0.3", - "hpagent": "^1.0.0", "lodash": "^4.17.21", - "semver": "^7.3.7", + "semver": "^7.3.8", "urijs": "^1.19.11" } }, @@ -7539,9 +7535,9 @@ "requires": {} }, "adm-zip": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.9.tgz", - "integrity": "sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg==" + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz", + "integrity": "sha512-x0HvcHqVJNTPk/Bw8JbLWlWoo6Wwnsug0fnYYro1HBrjxZ3G7/AZk7Ahv8JwDe1uIcz8eBqvu86FuF1POiG7vQ==" }, "ajv": { "version": "6.12.6", @@ -7662,12 +7658,13 @@ "dev": true }, "axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.2.2.tgz", + "integrity": "sha512-bz/J4gS2S3I7mpN/YZfGFTqhXTYzRho8Ay38w2otuuDR322KzFIWm/4W2K6gIwvWaws5n+mnb7D1lN9uD+QH6Q==", "requires": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, "axobject-query": { @@ -8720,9 +8717,9 @@ } }, "minimatch": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", - "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg==", "requires": { "brace-expansion": "^2.0.1" } @@ -8818,11 +8815,6 @@ "has-symbols": "^1.0.2" } }, - "hpagent": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/hpagent/-/hpagent-1.2.0.tgz", - "integrity": "sha512-A91dYTeIB6NoXG+PxTQpCCDDnfHsW9kc06Lvpu1TEe9gnd6ZFeiBoRO9JvzEv6xK7EX97/dUE8g/vBMTqTS3CA==" - }, "html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -10143,6 +10135,11 @@ "sisteransi": "^1.0.5" } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", diff --git a/package.json b/package.json index 77735710..28ec3d02 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ }, "dependencies": { "@actions/core": "^1.10.0", - "@octopusdeploy/api-client": "^2.1.1" + "@octopusdeploy/api-client": "^2.1.4" }, "description": "GitHub Action to Create a Release in Octopus Deploy", "devDependencies": { diff --git a/src/input-parameters.ts b/src/input-parameters.ts index b0cca331..9c9fb735 100644 --- a/src/input-parameters.ts +++ b/src/input-parameters.ts @@ -1,4 +1,5 @@ import { getBooleanInput, getInput, getMultilineInput } from '@actions/core' +import { PromptedVariableValues } from '@octopusdeploy/api-client' const EnvironmentVariables = { URL: 'OCTOPUS_URL', @@ -22,17 +23,17 @@ export interface InputParameters { // Optional useGuidedFailure?: boolean - variables?: Map + variables?: PromptedVariableValues } export function getInputParameters(): InputParameters { - let variablesMap: Map | undefined = undefined + let variablesMap: PromptedVariableValues | undefined = undefined const variables = getMultilineInput('variables').map(p => p.trim()) || undefined if (variables) { - variablesMap = new Map() + variablesMap = {} for (const variable of variables) { const variableMap = variable.split(':').map(x => x.trim()) - variablesMap?.set(variableMap[0], variableMap[1]) + variablesMap[variableMap[0]] = variableMap[1] } }