From 33c7f48be9f42949267b0aae73d92e21dd8b7cfa Mon Sep 17 00:00:00 2001 From: Andres Jardon <119068809+aj-aws@users.noreply.github.com> Date: Thu, 18 Jan 2024 17:44:00 -0800 Subject: [PATCH 01/11] fix: update output variable validation regex and limit (#286) * fix: update output variable validation regex and limit * fix: update output variable validation regex and limit --- .../adk-core/lib/toolkit/sdk/core/core.ts | 2 +- packages/adk-core/test/core.test.ts | 22 ++++++++++--------- packages/adk-utils/lib/util/util.ts | 5 ++++- packages/adk-utils/test/util.test.ts | 16 ++++++++------ .../templates/codecatalyst_model_schema.json | 2 +- 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/packages/adk-core/lib/toolkit/sdk/core/core.ts b/packages/adk-core/lib/toolkit/sdk/core/core.ts index 6b032f8e7..6cd1180f9 100644 --- a/packages/adk-core/lib/toolkit/sdk/core/core.ts +++ b/packages/adk-core/lib/toolkit/sdk/core/core.ts @@ -38,7 +38,7 @@ export function getEnvironmentVariable(inputVar: string) { /** * Sets the output value for the action output parameter. * -* @param varName The name of the environment variable. The variable must match the ^[A-Za-z0-9][A-Za-z0-9\-_]{1,30}[A-Za-z0-9]$ pattern. +* @param varName The name of the environment variable. The variable must match the ^[A-Za-z0-9@\-_]+$ pattern. * @param varValue The fully resolved value of the output variable. * * @return The result of running `echo ${varName}`. diff --git a/packages/adk-core/test/core.test.ts b/packages/adk-core/test/core.test.ts index 550a1dd1a..554915cb7 100644 --- a/packages/adk-core/test/core.test.ts +++ b/packages/adk-core/test/core.test.ts @@ -77,15 +77,20 @@ describe('@aws/codecatalyst-adk-core', () => { it('test setOutput validation', () => { const errorMessage = `Invalid output parameter name, it must match the following pattern ${outputVariableNamePattern}`; const outputParamValue = 'outputParamValue'; - const validInput30Chars = 'Stack_ID_12345678910111213145'; + const validInput40Chars = 'Stack_ID-1234567891011121314512345678911'; + const validInput = 'Stack_ID'; const emptyInput = ''; const invalidInput = 'Stack ID'; - const tooLongInput = 'longer_than_30_chars_123456789101112131415161718'; - const startsWithInvalidChar = '-Stack_ID'; - const endsWithInvalidChar = 'Stack_ID-'; + const maxInput = 'max_input_255_chars_1234567891011121314151617184876123578457689295628925764582347652874956284956824123456789101112131415161718487612357845768929562892576458234765287495628495682412345678910111213141516171848761235784576892956289257645823476528749562849591'; + const tooLongInput = 'longer_than_255_chars_123456789101112131415161718487612357845768929562892576458234765287495628495682412345678910111213141516171848761235784576892956289257645823476528749562849568241234567891011121314151617184876123578457689295628925764582347652874956284959'; + const validInputSpecialChar = '-StackA_a-@_ID'; + const invalidInputWithInvalidSpecialChar = 'Stack$#:ID'; - expect(adkCore.setOutput(validInput30Chars, outputParamValue).code === undefined).toBeTruthy(); + expect(adkCore.setOutput(validInput40Chars, outputParamValue).code === undefined).toBeTruthy(); + expect(adkCore.setOutput(validInput, outputParamValue).code === undefined).toBeTruthy(); + expect(adkCore.setOutput(validInputSpecialChar, outputParamValue).code === undefined).toBeTruthy(); + expect(adkCore.setOutput(maxInput, outputParamValue).code === undefined).toBeTruthy(); expect(adkCore.setOutput(emptyInput, outputParamValue).code === 1).toBeTruthy(); expect(adkCore.setOutput(emptyInput, outputParamValue).stdout === errorMessage).toBeTruthy(); @@ -96,11 +101,8 @@ describe('@aws/codecatalyst-adk-core', () => { expect(adkCore.setOutput(tooLongInput, outputParamValue).code === 1).toBeTruthy(); expect(adkCore.setOutput(tooLongInput, outputParamValue).stdout === errorMessage).toBeTruthy(); - expect(adkCore.setOutput(startsWithInvalidChar, outputParamValue).code === 1).toBeTruthy(); - expect(adkCore.setOutput(startsWithInvalidChar, outputParamValue).stdout === errorMessage).toBeTruthy(); - - expect(adkCore.setOutput(endsWithInvalidChar, outputParamValue).code === 1).toBeTruthy(); - expect(adkCore.setOutput(endsWithInvalidChar, outputParamValue).stdout === errorMessage).toBeTruthy(); + expect(adkCore.setOutput(invalidInputWithInvalidSpecialChar, outputParamValue).code === 1).toBeTruthy(); + expect(adkCore.setOutput(invalidInputWithInvalidSpecialChar, outputParamValue).stdout === errorMessage).toBeTruthy(); }); }); diff --git a/packages/adk-utils/lib/util/util.ts b/packages/adk-utils/lib/util/util.ts index 337855b78..55f84b33a 100644 --- a/packages/adk-utils/lib/util/util.ts +++ b/packages/adk-utils/lib/util/util.ts @@ -1,6 +1,6 @@ import fs from 'fs'; -export const outputVariableNamePattern = new RegExp(/^[A-Za-z0-9][A-Za-z0-9\-_]{1,30}[A-Za-z0-9]$/); +export const outputVariableNamePattern = new RegExp(/^[A-Za-z0-9@\-_]+$/); /** * Sanitizes (escapes) special characters in the command and its arguments. @@ -91,5 +91,8 @@ export function writeContentToFileSync(dest: string, content: string, overrideDe * @param varName The destination file. */ export function isValidOutputVariableName(varName: string): boolean { + if (!varName || varName.length < 1 || varName.length > 255) { + return false; + } return outputVariableNamePattern.test(varName); } diff --git a/packages/adk-utils/test/util.test.ts b/packages/adk-utils/test/util.test.ts index b4e89fcd7..8a7974f2e 100644 --- a/packages/adk-utils/test/util.test.ts +++ b/packages/adk-utils/test/util.test.ts @@ -129,19 +129,21 @@ describe('ADK-Util test', () => { it('test validateOutputVariableName', async () => { const validInput = 'Stack_ID'; - const validInput30Chars = 'Stack_ID_12345678910111213145'; + const validInput40Chars = 'Stack_ID-1234567891011121314512345678911'; const emptyInput = ''; const invalidInput = 'Stack ID'; - const tooLongInput = 'longer_than_30_chars_123456789101112131415161718'; - const startsWithInvalidChar = '-Stack_ID'; - const endsWithInvalidChar = 'Stack_ID-'; + const maxInput = 'max_input_255_chars_1234567891011121314151617184876123578457689295628925764582347652874956284956824123456789101112131415161718487612357845768929562892576458234765287495628495682412345678910111213141516171848761235784576892956289257645823476528749562849591'; + const tooLongInput = 'longer_than_255_chars_123456789101112131415161718487612357845768929562892576458234765287495628495682412345678910111213141516171848761235784576892956289257645823476528749562849568241234567891011121314151617184876123578457689295628925764582347652874956284959'; + const validInputSpecialChar = '-StackA_a-@_ID'; + const invalidInputWithInvalidSpecialChar = 'Stack/$#:ID'; expect(isValidOutputVariableName(validInput)).toBeTruthy(); - expect(isValidOutputVariableName(validInput30Chars)).toBeTruthy(); + expect(isValidOutputVariableName(validInput40Chars)).toBeTruthy(); expect(isValidOutputVariableName(emptyInput)).toBeFalsy(); expect(isValidOutputVariableName(invalidInput)).toBeFalsy(); + expect(isValidOutputVariableName(maxInput)).toBeTruthy(); expect(isValidOutputVariableName(tooLongInput)).toBeFalsy(); - expect(isValidOutputVariableName(startsWithInvalidChar)).toBeFalsy(); - expect(isValidOutputVariableName(endsWithInvalidChar)).toBeFalsy(); + expect(isValidOutputVariableName(validInputSpecialChar)).toBeTruthy(); + expect(isValidOutputVariableName(invalidInputWithInvalidSpecialChar)).toBeFalsy(); }); }); diff --git a/packages/adk/templates/codecatalyst_model_schema.json b/packages/adk/templates/codecatalyst_model_schema.json index 806954bd3..b0a2cccec 100644 --- a/packages/adk/templates/codecatalyst_model_schema.json +++ b/packages/adk/templates/codecatalyst_model_schema.json @@ -91,7 +91,7 @@ "description": "Action output variables", "type": "object", "propertyNames": { - "pattern": "^[A-Za-z0-9][A-Za-z0-9\\-_]{1,30}[A-Za-z0-9]$" + "pattern": "^[A-Za-z0-9@\\-_]+$" }, "minProperties": 1, "maxProperties": 10, From 12b3e3c6dca9c2f06f37b8bcb08494b066c7f1d4 Mon Sep 17 00:00:00 2001 From: ActionsDevKitRelease Date: Fri, 19 Jan 2024 01:51:25 +0000 Subject: [PATCH 02/11] chore(release): v1.0.18 --- CHANGELOG.md | 11 +++++++++++ lerna.json | 2 +- packages/adk-core/CHANGELOG.md | 11 +++++++++++ packages/adk-core/package.json | 4 ++-- packages/adk-model-parser/CHANGELOG.md | 11 +++++++++++ packages/adk-model-parser/package.json | 2 +- packages/adk-utils/CHANGELOG.md | 11 +++++++++++ packages/adk-utils/package.json | 2 +- packages/adk/CHANGELOG.md | 11 +++++++++++ packages/adk/package.json | 6 +++--- packages/codecatalyst-entities/project/CHANGELOG.md | 11 +++++++++++ packages/codecatalyst-entities/project/package.json | 4 ++-- .../codecatalyst-entities/run-summaries/CHANGELOG.md | 11 +++++++++++ .../codecatalyst-entities/run-summaries/package.json | 4 ++-- packages/codecatalyst-entities/space/CHANGELOG.md | 11 +++++++++++ packages/codecatalyst-entities/space/package.json | 4 ++-- 16 files changed, 102 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f23ecc4ff..2ed464fe5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 1.0.18 (2024-01-19) + + +### Bug Fixes + +* update output variable validation regex and limit ([#286](https://github.com/aws/actions-dev-kit/issues/286)) ([33c7f48](https://github.com/aws/actions-dev-kit/commit/33c7f48be9f42949267b0aae73d92e21dd8b7cfa)) + + + + + ## 1.0.17 (2024-01-11) diff --git a/lerna.json b/lerna.json index af0b7f5e5..76da3cfc5 100644 --- a/lerna.json +++ b/lerna.json @@ -5,7 +5,7 @@ "packages/*", "packages/codecatalyst-entities/*" ], - "version": "1.0.17", + "version": "1.0.18", "command": { "version": { "allowBranch": "main", diff --git a/packages/adk-core/CHANGELOG.md b/packages/adk-core/CHANGELOG.md index 518d7591d..065e6d16a 100644 --- a/packages/adk-core/CHANGELOG.md +++ b/packages/adk-core/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 1.0.18 (2024-01-19) + + +### Bug Fixes + +* update output variable validation regex and limit ([#286](https://github.com/aws/actions-dev-kit/issues/286)) ([33c7f48](https://github.com/aws/actions-dev-kit/commit/33c7f48be9f42949267b0aae73d92e21dd8b7cfa)) + + + + + ## 1.0.17 (2024-01-11) diff --git a/packages/adk-core/package.json b/packages/adk-core/package.json index 5f02009e6..969dc2be2 100644 --- a/packages/adk-core/package.json +++ b/packages/adk-core/package.json @@ -1,6 +1,6 @@ { "name": "@aws/codecatalyst-adk-core", - "version": "1.0.17", + "version": "1.0.18", "description": "ADK Core", "homepage": "", "main": "lib/toolkit/sdk/core/core.js", @@ -24,7 +24,7 @@ "api-ref": "typedoc" }, "dependencies": { - "@aws/codecatalyst-adk-utils": "1.0.17", + "@aws/codecatalyst-adk-utils": "1.0.18", "@types/shelljs": "^0.8.11", "shelljs": "^0.8.5" }, diff --git a/packages/adk-model-parser/CHANGELOG.md b/packages/adk-model-parser/CHANGELOG.md index 1fd121a92..e3e4fd94a 100644 --- a/packages/adk-model-parser/CHANGELOG.md +++ b/packages/adk-model-parser/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 1.0.18 (2024-01-19) + + +### Bug Fixes + +* update output variable validation regex and limit ([#286](https://github.com/aws/actions-dev-kit/issues/286)) ([33c7f48](https://github.com/aws/actions-dev-kit/commit/33c7f48be9f42949267b0aae73d92e21dd8b7cfa)) + + + + + ## 1.0.17 (2024-01-11) diff --git a/packages/adk-model-parser/package.json b/packages/adk-model-parser/package.json index 26f483075..23c866163 100644 --- a/packages/adk-model-parser/package.json +++ b/packages/adk-model-parser/package.json @@ -1,6 +1,6 @@ { "name": "@aws/codecatalyst-adk-model-parser", - "version": "1.0.17", + "version": "1.0.18", "description": "Model parser for CodeCatalyst action model", "homepage": "", "license": "Apache-2.0", diff --git a/packages/adk-utils/CHANGELOG.md b/packages/adk-utils/CHANGELOG.md index c9134e6c8..c76f18443 100644 --- a/packages/adk-utils/CHANGELOG.md +++ b/packages/adk-utils/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 1.0.18 (2024-01-19) + + +### Bug Fixes + +* update output variable validation regex and limit ([#286](https://github.com/aws/actions-dev-kit/issues/286)) ([33c7f48](https://github.com/aws/actions-dev-kit/commit/33c7f48be9f42949267b0aae73d92e21dd8b7cfa)) + + + + + ## 1.0.17 (2024-01-11) diff --git a/packages/adk-utils/package.json b/packages/adk-utils/package.json index b5f11473b..596253f98 100644 --- a/packages/adk-utils/package.json +++ b/packages/adk-utils/package.json @@ -1,6 +1,6 @@ { "name": "@aws/codecatalyst-adk-utils", - "version": "1.0.17", + "version": "1.0.18", "description": "ADK UTIL", "homepage": "", "license": "Apache-2.0", diff --git a/packages/adk/CHANGELOG.md b/packages/adk/CHANGELOG.md index 06a078194..cc4145fc4 100644 --- a/packages/adk/CHANGELOG.md +++ b/packages/adk/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 1.0.18 (2024-01-19) + + +### Bug Fixes + +* update output variable validation regex and limit ([#286](https://github.com/aws/actions-dev-kit/issues/286)) ([33c7f48](https://github.com/aws/actions-dev-kit/commit/33c7f48be9f42949267b0aae73d92e21dd8b7cfa)) + + + + + ## 1.0.17 (2024-01-11) diff --git a/packages/adk/package.json b/packages/adk/package.json index 81bfc42fc..c7c14dcee 100644 --- a/packages/adk/package.json +++ b/packages/adk/package.json @@ -1,6 +1,6 @@ { "name": "@aws/codecatalyst-adk", - "version": "1.0.17", + "version": "1.0.18", "description": "ADK CLI", "homepage": "", "license": "Apache-2.0", @@ -29,8 +29,8 @@ "templates/**/*" ], "dependencies": { - "@aws/codecatalyst-adk-model-parser": "1.0.17", - "@aws/codecatalyst-adk-utils": "1.0.17", + "@aws/codecatalyst-adk-model-parser": "1.0.18", + "@aws/codecatalyst-adk-utils": "1.0.18", "@nestjs/common": "^10.0.0", "@nestjs/core": "^10.0.3", "js-yaml": "^4.1.0", diff --git a/packages/codecatalyst-entities/project/CHANGELOG.md b/packages/codecatalyst-entities/project/CHANGELOG.md index eb50dcd48..6d4b7ba62 100644 --- a/packages/codecatalyst-entities/project/CHANGELOG.md +++ b/packages/codecatalyst-entities/project/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 1.0.18 (2024-01-19) + + +### Bug Fixes + +* update output variable validation regex and limit ([#286](https://github.com/aws/actions-dev-kit/issues/286)) ([33c7f48](https://github.com/aws/actions-dev-kit/commit/33c7f48be9f42949267b0aae73d92e21dd8b7cfa)) + + + + + ## 1.0.17 (2024-01-11) diff --git a/packages/codecatalyst-entities/project/package.json b/packages/codecatalyst-entities/project/package.json index 8fd427bba..e2e2f2c3d 100644 --- a/packages/codecatalyst-entities/project/package.json +++ b/packages/codecatalyst-entities/project/package.json @@ -1,6 +1,6 @@ { "name": "@aws/codecatalyst-project", - "version": "1.0.17", + "version": "1.0.18", "description": "CodeCatalyst project entity", "homepage": "", "license": "Apache-2.0", @@ -23,7 +23,7 @@ "api-ref": "typedoc" }, "devDependencies": { - "@aws/codecatalyst-adk-core": "1.0.17" + "@aws/codecatalyst-adk-core": "1.0.18" }, "typedoc": { "entryPoint": "lib/index.ts" diff --git a/packages/codecatalyst-entities/run-summaries/CHANGELOG.md b/packages/codecatalyst-entities/run-summaries/CHANGELOG.md index 71afa6bad..382ec58ed 100644 --- a/packages/codecatalyst-entities/run-summaries/CHANGELOG.md +++ b/packages/codecatalyst-entities/run-summaries/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 1.0.18 (2024-01-19) + + +### Bug Fixes + +* update output variable validation regex and limit ([#286](https://github.com/aws/actions-dev-kit/issues/286)) ([33c7f48](https://github.com/aws/actions-dev-kit/commit/33c7f48be9f42949267b0aae73d92e21dd8b7cfa)) + + + + + ## 1.0.17 (2024-01-11) diff --git a/packages/codecatalyst-entities/run-summaries/package.json b/packages/codecatalyst-entities/run-summaries/package.json index 17022060d..35c332545 100644 --- a/packages/codecatalyst-entities/run-summaries/package.json +++ b/packages/codecatalyst-entities/run-summaries/package.json @@ -1,6 +1,6 @@ { "name": "@aws/codecatalyst-run-summaries", - "version": "1.0.17", + "version": "1.0.18", "description": "CodeCatalyst run summaries entity", "homepage": "", "license": "Apache-2.0", @@ -26,6 +26,6 @@ "entryPoint": "lib/index.ts" }, "devDependencies": { - "@aws/codecatalyst-adk-core": "1.0.17" + "@aws/codecatalyst-adk-core": "1.0.18" } } diff --git a/packages/codecatalyst-entities/space/CHANGELOG.md b/packages/codecatalyst-entities/space/CHANGELOG.md index 647c68507..27919309b 100644 --- a/packages/codecatalyst-entities/space/CHANGELOG.md +++ b/packages/codecatalyst-entities/space/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 1.0.18 (2024-01-19) + + +### Bug Fixes + +* update output variable validation regex and limit ([#286](https://github.com/aws/actions-dev-kit/issues/286)) ([33c7f48](https://github.com/aws/actions-dev-kit/commit/33c7f48be9f42949267b0aae73d92e21dd8b7cfa)) + + + + + ## 1.0.17 (2024-01-11) diff --git a/packages/codecatalyst-entities/space/package.json b/packages/codecatalyst-entities/space/package.json index 6b157ed52..540146ae2 100644 --- a/packages/codecatalyst-entities/space/package.json +++ b/packages/codecatalyst-entities/space/package.json @@ -1,6 +1,6 @@ { "name": "@aws/codecatalyst-space", - "version": "1.0.17", + "version": "1.0.18", "description": "CodeCatalyst space entity", "homepage": "", "license": "Apache-2.0", @@ -23,7 +23,7 @@ "api-ref": "typedoc" }, "devDependencies": { - "@aws/codecatalyst-adk-core": "1.0.17" + "@aws/codecatalyst-adk-core": "1.0.18" }, "typedoc": { "entryPoint": "lib/index.ts" From 065c436ef1c366395fd9277b7f6d87861baed83f Mon Sep 17 00:00:00 2001 From: ActionsDevKitRelease Date: Fri, 19 Jan 2024 02:00:40 +0000 Subject: [PATCH 03/11] chore(docs): - update API reference --- .../_aws_codecatalyst_adk_core.Utils.html | 12 ++++++------ ...odecatalyst_run_summaries.RunSummaries.html | 12 ++++++------ ...catalyst_run_summaries.RunSummaryLevel.html | 4 ++-- .../_aws_codecatalyst_adk.adkCli.html | 2 +- .../_aws_codecatalyst_adk_core.command.html | 2 +- ...talyst_adk_core.getEnvironmentVariable.html | 2 +- .../_aws_codecatalyst_adk_core.getInput.html | 2 +- ...odecatalyst_adk_core.getMultiLineInput.html | 2 +- .../_aws_codecatalyst_adk_core.setFailed.html | 2 +- .../_aws_codecatalyst_adk_core.setOutput.html | 4 ++-- ..._model_parser.parseAndSanitizeYamlFile.html | 2 +- ..._codecatalyst_adk_utils.copyToFileSync.html | 2 +- .../_aws_codecatalyst_adk_utils.escape.html | 2 +- .../_aws_codecatalyst_adk_utils.isString.html | 2 +- ...st_adk_utils.isValidOutputVariableName.html | 2 +- ...codecatalyst_adk_utils.sanitizeCommand.html | 2 +- ...lyst_adk_utils.unknownToBooleanOrFalse.html | 2 +- ...t_adk_utils.unknownToStringOrUndefined.html | 2 +- ...alyst_adk_utils.writeContentToFileSync.html | 2 +- .../_aws_codecatalyst_project.getProject.html | 2 +- .../_aws_codecatalyst_space.getSpace.html | 2 +- ...s_codecatalyst_adk_core.ICommandOutput.html | 8 ++++---- ...atalyst_adk_model_parser.Configuration.html | 2 +- ...ecatalyst_adk_model_parser.Environment.html | 4 ++-- ...ws_codecatalyst_adk_model_parser.Input.html | 12 ++++++------ ...ws_codecatalyst_adk_model_parser.Model.html | 18 +++++++++--------- ...odecatalyst_adk_model_parser.RunConfig.html | 6 +++--- ..._codecatalyst_adk_model_parser.Sources.html | 4 ++-- .../_aws_codecatalyst_project.Project.html | 6 +++--- ...aws_codecatalyst_run_summaries.Message.html | 10 +++++----- ...talyst_run_summaries.RunSummaryMessage.html | 10 +++++----- ...atalyst_run_summaries.TemplateVariable.html | 6 +++--- .../_aws_codecatalyst_space.Space.html | 6 +++--- docs/modules/_aws_codecatalyst_adk.html | 2 +- docs/modules/_aws_codecatalyst_adk_core.html | 2 +- .../_aws_codecatalyst_adk_model_parser.html | 2 +- docs/modules/_aws_codecatalyst_adk_utils.html | 2 +- docs/modules/_aws_codecatalyst_project.html | 2 +- .../_aws_codecatalyst_run_summaries.html | 2 +- docs/modules/_aws_codecatalyst_space.html | 2 +- ...st_adk_utils.outputVariableNamePattern.html | 2 +- 41 files changed, 87 insertions(+), 87 deletions(-) diff --git a/docs/classes/_aws_codecatalyst_adk_core.Utils.html b/docs/classes/_aws_codecatalyst_adk_core.Utils.html index a4f67ff54..b6e5e81a2 100644 --- a/docs/classes/_aws_codecatalyst_adk_core.Utils.html +++ b/docs/classes/_aws_codecatalyst_adk_core.Utils.html @@ -24,7 +24,7 @@

Hierarchy

+
  • Defined in adk-core/lib/toolkit/sdk/core/core.ts:91
  • @@ -72,7 +72,7 @@
    disableStdInput: booleanOptional args: string[]

    Returns ICommandOutput

    +
  • Defined in adk-core/lib/toolkit/sdk/core/core.ts:113
    • @@ -87,7 +87,7 @@

      Parameters

      inputVar: string

    Returns undefined | string

    +
  • Defined in adk-core/lib/toolkit/sdk/core/core.ts:103
    • @@ -102,7 +102,7 @@

      Parameters

      Optional inputVar: string

    Returns undefined | string

    +
  • Defined in adk-core/lib/toolkit/sdk/core/core.ts:93
    • @@ -117,7 +117,7 @@

      Parameters

      Optional inputVar: string

    Returns undefined | string

    +
  • Defined in adk-core/lib/toolkit/sdk/core/core.ts:98
    • @@ -134,7 +134,7 @@
      varName: string
      varValue: string

    Returns any

    +
  • Defined in adk-core/lib/toolkit/sdk/core/core.ts:108
  • Returns void

    +
  • Defined in codecatalyst-entities/run-summaries/lib/run-summaries.ts:25
  • +
  • Defined in codecatalyst-entities/run-summaries/lib/run-summaries.ts:38
    • @@ -112,7 +112,7 @@
      s: string
      length: number

    Returns string

    +
  • Defined in codecatalyst-entities/run-summaries/lib/run-summaries.ts:43
  • +
  • Defined in codecatalyst-entities/run-summaries/lib/types/types.ts:5
  • @@ -37,7 +37,7 @@

    Enumeration Members

    ERROR: "Error"
    +
  • Defined in codecatalyst-entities/run-summaries/lib/types/types.ts:6
  • Returns void

    +
  • Defined in adk/lib/adk.ts:147
  • Returns undefined | string

    +
  • Defined in adk-core/lib/toolkit/sdk/core/core.ts:34
  • Returns undefined | string

    +
  • Defined in adk-core/lib/toolkit/sdk/core/core.ts:11
  • Returns undefined | string

    +
  • Defined in adk-core/lib/toolkit/sdk/core/core.ts:22
  • Returns void

    +
  • Defined in adk-core/lib/toolkit/sdk/core/core.ts:72
  • Returns any

    +
  • Defined in adk-core/lib/toolkit/sdk/core/core.ts:46
  • Returns Model

    +
  • Defined in adk-model-parser/lib/parser/parser.ts:14
  • +
  • Defined in adk-utils/lib/util/util.ts:71
  • Returns boolean

    +
  • Defined in adk-utils/lib/util/util.ts:43
  • Returns boolean

    +
  • Defined in adk-utils/lib/util/util.ts:93
  • Returns boolean

    +
  • Defined in adk-utils/lib/util/util.ts:61
  • Returns string | undefined

    +
  • Defined in adk-utils/lib/util/util.ts:52
  • +
  • Defined in adk-utils/lib/util/util.ts:83
  • +
  • Defined in adk-core/lib/toolkit/sdk/core/core.ts:83
  • +
  • Defined in adk-core/lib/toolkit/sdk/core/core.ts:1
  • diff --git a/docs/modules/_aws_codecatalyst_adk_model_parser.html b/docs/modules/_aws_codecatalyst_adk_model_parser.html index 9b6d05cdb..fae0ce067 100644 --- a/docs/modules/_aws_codecatalyst_adk_model_parser.html +++ b/docs/modules/_aws_codecatalyst_adk_model_parser.html @@ -16,7 +16,7 @@
  • @aws/codecatalyst-adk-model-parser
  • Module @aws/codecatalyst-adk-model-parser

    +
  • Defined in adk-model-parser/lib/index.ts:1
  • diff --git a/docs/modules/_aws_codecatalyst_adk_utils.html b/docs/modules/_aws_codecatalyst_adk_utils.html index 577b2b302..0962b7eda 100644 --- a/docs/modules/_aws_codecatalyst_adk_utils.html +++ b/docs/modules/_aws_codecatalyst_adk_utils.html @@ -16,7 +16,7 @@
  • @aws/codecatalyst-adk-utils
  • Module @aws/codecatalyst-adk-utils

    +
  • Defined in adk-utils/lib/index.ts:1
  • diff --git a/docs/modules/_aws_codecatalyst_project.html b/docs/modules/_aws_codecatalyst_project.html index 271522981..f0acd0f59 100644 --- a/docs/modules/_aws_codecatalyst_project.html +++ b/docs/modules/_aws_codecatalyst_project.html @@ -16,7 +16,7 @@
  • @aws/codecatalyst-project
  • Module @aws/codecatalyst-project

    +
  • Defined in codecatalyst-entities/project/lib/index.ts:1
  • diff --git a/docs/modules/_aws_codecatalyst_run_summaries.html b/docs/modules/_aws_codecatalyst_run_summaries.html index 1760c6005..99e7e2448 100644 --- a/docs/modules/_aws_codecatalyst_run_summaries.html +++ b/docs/modules/_aws_codecatalyst_run_summaries.html @@ -16,7 +16,7 @@
  • @aws/codecatalyst-run-summaries
  • Module @aws/codecatalyst-run-summaries

    +
  • Defined in codecatalyst-entities/run-summaries/lib/index.ts:1
  • diff --git a/docs/modules/_aws_codecatalyst_space.html b/docs/modules/_aws_codecatalyst_space.html index 9e92e1bed..8f582b31f 100644 --- a/docs/modules/_aws_codecatalyst_space.html +++ b/docs/modules/_aws_codecatalyst_space.html @@ -16,7 +16,7 @@
  • @aws/codecatalyst-space
  • Module @aws/codecatalyst-space

    +
  • Defined in codecatalyst-entities/space/lib/index.ts:1
  • diff --git a/docs/variables/_aws_codecatalyst_adk_utils.outputVariableNamePattern.html b/docs/variables/_aws_codecatalyst_adk_utils.outputVariableNamePattern.html index ab057e4f0..abf3e7fb4 100644 --- a/docs/variables/_aws_codecatalyst_adk_utils.outputVariableNamePattern.html +++ b/docs/variables/_aws_codecatalyst_adk_utils.outputVariableNamePattern.html @@ -18,7 +18,7 @@

    Variable outputVariableNamePatternConst

    outputVariableNamePattern: RegExp = ...
    +
  • Defined in adk-utils/lib/util/util.ts:3
  • diff --git a/docs/functions/_aws_codecatalyst_adk_core.getInput.html b/docs/functions/_aws_codecatalyst_adk_core.getInput.html index 81733331b..3d6d14d87 100644 --- a/docs/functions/_aws_codecatalyst_adk_core.getInput.html +++ b/docs/functions/_aws_codecatalyst_adk_core.getInput.html @@ -103,8 +103,8 @@

    @@ -349,6 +349,14 @@

    >getInput +
  • + + + getInputParam +
  • @@ -357,6 +365,14 @@

    >getMultiLineInput

  • +
  • + + + runCommand +
  • @@ -365,6 +381,14 @@

    >setFailed

  • +
  • + + + setFailure +
  • @@ -373,6 +397,22 @@

    >setOutput

  • +
  • + + + setOutputParam +
  • +
  • + + + validateInput +
  • diff --git a/docs/functions/_aws_codecatalyst_adk_core.getInputParam.html b/docs/functions/_aws_codecatalyst_adk_core.getInputParam.html new file mode 100644 index 000000000..3e9e08960 --- /dev/null +++ b/docs/functions/_aws_codecatalyst_adk_core.getInputParam.html @@ -0,0 +1,417 @@ + + + + + + getInputParam | adk + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    + +

    Function getInputParam

    +
    +
    + +
    +
    + +
    +
    +

    Generated using TypeDoc

    +
    +
    + + + diff --git a/docs/functions/_aws_codecatalyst_adk_core.getMultiLineInput.html b/docs/functions/_aws_codecatalyst_adk_core.getMultiLineInput.html index 3ca783925..15aaa6391 100644 --- a/docs/functions/_aws_codecatalyst_adk_core.getMultiLineInput.html +++ b/docs/functions/_aws_codecatalyst_adk_core.getMultiLineInput.html @@ -103,8 +103,8 @@

    @@ -349,6 +349,14 @@

    >getInput +
  • + + + getInputParam +
  • @@ -357,6 +365,14 @@

    >getMultiLineInput

  • +
  • + + + runCommand +
  • @@ -365,6 +381,14 @@

    >setFailed

  • +
  • + + + setFailure +
  • @@ -373,6 +397,22 @@

    >setOutput

  • +
  • + + + setOutputParam +
  • +
  • + + + validateInput +
  • diff --git a/docs/functions/_aws_codecatalyst_adk_core.runCommand.html b/docs/functions/_aws_codecatalyst_adk_core.runCommand.html new file mode 100644 index 000000000..9784bb39d --- /dev/null +++ b/docs/functions/_aws_codecatalyst_adk_core.runCommand.html @@ -0,0 +1,435 @@ + + + + + + runCommand | adk + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    + +

    Function runCommand

    +
    +
    + +
    +
    + +
    +
    +

    Generated using TypeDoc

    +
    +
    + + + diff --git a/docs/functions/_aws_codecatalyst_adk_core.setFailed.html b/docs/functions/_aws_codecatalyst_adk_core.setFailed.html index 3a887a213..8d6b763ba 100644 --- a/docs/functions/_aws_codecatalyst_adk_core.setFailed.html +++ b/docs/functions/_aws_codecatalyst_adk_core.setFailed.html @@ -92,8 +92,8 @@

    Returns void
  • Defined in - adk-core/lib/toolkit/sdk/core/core.ts:72adk/adk-core/src/toolkit/sdk/core/core.ts:69
  • @@ -338,6 +338,14 @@

    >getInput +
  • + + + getInputParam +
  • @@ -346,6 +354,14 @@

    >getMultiLineInput

  • +
  • + + + runCommand +
  • @@ -354,6 +370,14 @@

    >setFailed

  • +
  • + + + setFailure +
  • @@ -362,6 +386,22 @@

    >setOutput

  • +
  • + + + setOutputParam +
  • +
  • + + + validateInput +
  • diff --git a/docs/functions/_aws_codecatalyst_adk_core.setFailure.html b/docs/functions/_aws_codecatalyst_adk_core.setFailure.html new file mode 100644 index 000000000..4851640cc --- /dev/null +++ b/docs/functions/_aws_codecatalyst_adk_core.setFailure.html @@ -0,0 +1,417 @@ + + + + + + setFailure | adk + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    + +

    Function setFailure

    +
    +
    + +
    +
    + +
    +
    +

    Generated using TypeDoc

    +
    +
    + + + diff --git a/docs/functions/_aws_codecatalyst_adk_core.setOutput.html b/docs/functions/_aws_codecatalyst_adk_core.setOutput.html index c9e628249..6b6e6be5c 100644 --- a/docs/functions/_aws_codecatalyst_adk_core.setOutput.html +++ b/docs/functions/_aws_codecatalyst_adk_core.setOutput.html @@ -104,8 +104,8 @@

    Returns any
  • Defined in - adk-core/lib/toolkit/sdk/core/core.ts:46adk/adk-core/src/toolkit/sdk/core/core.ts:46
  • @@ -350,6 +350,14 @@

    >getInput +
  • + + + getInputParam +
  • @@ -358,6 +366,14 @@

    >getMultiLineInput

  • +
  • + + + runCommand +
  • @@ -366,6 +382,14 @@

    >setFailed

  • +
  • + + + setFailure +
  • @@ -374,6 +398,22 @@

    >setOutput

  • +
  • + + + setOutputParam +
  • +
  • + + + validateInput +
  • diff --git a/docs/functions/_aws_codecatalyst_adk_core.setOutputParam.html b/docs/functions/_aws_codecatalyst_adk_core.setOutputParam.html new file mode 100644 index 000000000..79a2b23df --- /dev/null +++ b/docs/functions/_aws_codecatalyst_adk_core.setOutputParam.html @@ -0,0 +1,417 @@ + + + + + + setOutputParam | adk + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    + +

    Function setOutputParam

    +
    +
    + +
    +
    + +
    +
    +

    Generated using TypeDoc

    +
    +
    + + + diff --git a/docs/functions/_aws_codecatalyst_adk_core.validateInput.html b/docs/functions/_aws_codecatalyst_adk_core.validateInput.html new file mode 100644 index 000000000..3cb316276 --- /dev/null +++ b/docs/functions/_aws_codecatalyst_adk_core.validateInput.html @@ -0,0 +1,417 @@ + + + + + + validateInput | adk + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    + +

    Function validateInput

    +
    +
    + +
    +
    + +
    +
    +

    Generated using TypeDoc

    +
    +
    + + + diff --git a/docs/functions/_aws_codecatalyst_adk_model_parser.parseAndSanitizeYamlFile.html b/docs/functions/_aws_codecatalyst_adk_model_parser.parseAndSanitizeYamlFile.html index bc4c82c45..ff655f74d 100644 --- a/docs/functions/_aws_codecatalyst_adk_model_parser.parseAndSanitizeYamlFile.html +++ b/docs/functions/_aws_codecatalyst_adk_model_parser.parseAndSanitizeYamlFile.html @@ -105,8 +105,8 @@

    diff --git a/docs/functions/_aws_codecatalyst_adk_utils.copyToFileSync.html b/docs/functions/_aws_codecatalyst_adk_utils.copyToFileSync.html index b8ae351c0..aa1a52086 100644 --- a/docs/functions/_aws_codecatalyst_adk_utils.copyToFileSync.html +++ b/docs/functions/_aws_codecatalyst_adk_utils.copyToFileSync.html @@ -104,8 +104,8 @@

    Returns void
  • Defined in - adk-utils/lib/util/util.ts:71adk/adk-utils/src/util/util.ts:67
  • diff --git a/docs/functions/_aws_codecatalyst_adk_utils.escape.html b/docs/functions/_aws_codecatalyst_adk_utils.escape.html index a4931bdb9..178e8a88a 100644 --- a/docs/functions/_aws_codecatalyst_adk_utils.escape.html +++ b/docs/functions/_aws_codecatalyst_adk_utils.escape.html @@ -97,8 +97,8 @@

    Returns string
  • Defined in - adk-utils/lib/util/util.ts:29adk/adk-utils/src/util/util.ts:30
  • diff --git a/docs/functions/_aws_codecatalyst_adk_utils.isString.html b/docs/functions/_aws_codecatalyst_adk_utils.isString.html index ddccdc906..26783cb99 100644 --- a/docs/functions/_aws_codecatalyst_adk_utils.isString.html +++ b/docs/functions/_aws_codecatalyst_adk_utils.isString.html @@ -97,8 +97,8 @@

    Returns boolean
  • Defined in - adk-utils/lib/util/util.ts:43adk/adk-utils/src/util/util.ts:39
  • diff --git a/docs/functions/_aws_codecatalyst_adk_utils.isValidOutputVariableName.html b/docs/functions/_aws_codecatalyst_adk_utils.isValidOutputVariableName.html index 392541789..53989ba33 100644 --- a/docs/functions/_aws_codecatalyst_adk_utils.isValidOutputVariableName.html +++ b/docs/functions/_aws_codecatalyst_adk_utils.isValidOutputVariableName.html @@ -101,8 +101,8 @@

    Returns boolean
  • Defined in - adk-utils/lib/util/util.ts:93adk/adk-utils/src/util/util.ts:89
  • diff --git a/docs/functions/_aws_codecatalyst_adk_utils.sanitizeCommand.html b/docs/functions/_aws_codecatalyst_adk_utils.sanitizeCommand.html index 1181e3846..6ab402224 100644 --- a/docs/functions/_aws_codecatalyst_adk_utils.sanitizeCommand.html +++ b/docs/functions/_aws_codecatalyst_adk_utils.sanitizeCommand.html @@ -110,8 +110,8 @@

    Returns string
  • Defined in - adk-utils/lib/util/util.ts:12adk/adk-utils/src/util/util.ts:12
  • diff --git a/docs/functions/_aws_codecatalyst_adk_utils.unknownToBooleanOrFalse.html b/docs/functions/_aws_codecatalyst_adk_utils.unknownToBooleanOrFalse.html index bffb7675d..a758eb126 100644 --- a/docs/functions/_aws_codecatalyst_adk_utils.unknownToBooleanOrFalse.html +++ b/docs/functions/_aws_codecatalyst_adk_utils.unknownToBooleanOrFalse.html @@ -98,8 +98,8 @@

    Returns boolean
  • Defined in - adk-utils/lib/util/util.ts:61adk/adk-utils/src/util/util.ts:57
  • diff --git a/docs/functions/_aws_codecatalyst_adk_utils.unknownToStringOrUndefined.html b/docs/functions/_aws_codecatalyst_adk_utils.unknownToStringOrUndefined.html index 81109f692..fe7508792 100644 --- a/docs/functions/_aws_codecatalyst_adk_utils.unknownToStringOrUndefined.html +++ b/docs/functions/_aws_codecatalyst_adk_utils.unknownToStringOrUndefined.html @@ -102,8 +102,8 @@

    diff --git a/docs/functions/_aws_codecatalyst_adk_utils.writeContentToFileSync.html b/docs/functions/_aws_codecatalyst_adk_utils.writeContentToFileSync.html index 4bd9db498..c2da710df 100644 --- a/docs/functions/_aws_codecatalyst_adk_utils.writeContentToFileSync.html +++ b/docs/functions/_aws_codecatalyst_adk_utils.writeContentToFileSync.html @@ -105,8 +105,8 @@

    Returns void
  • Defined in - adk-utils/lib/util/util.ts:83adk/adk-utils/src/util/util.ts:79
  • diff --git a/docs/functions/_aws_codecatalyst_project.getProject.html b/docs/functions/_aws_codecatalyst_project.getProject.html index 48629b85d..47cfd6d42 100644 --- a/docs/functions/_aws_codecatalyst_project.getProject.html +++ b/docs/functions/_aws_codecatalyst_project.getProject.html @@ -94,8 +94,8 @@

    diff --git a/docs/functions/_aws_codecatalyst_space.getSpace.html b/docs/functions/_aws_codecatalyst_space.getSpace.html index ca1ce210c..758ad1223 100644 --- a/docs/functions/_aws_codecatalyst_space.getSpace.html +++ b/docs/functions/_aws_codecatalyst_space.getSpace.html @@ -93,8 +93,8 @@

    diff --git a/docs/index.html b/docs/index.html index 7de23494a..d6e1a2027 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,178 +1,377 @@ -adk
    -
    - -
    -
    -
    -
    -

    adk

    -
    - -

    Action Development Kit (ADK)

    -
    + + + + + + adk + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +

    adk

    +
    +
    + +

    Action Development Kit (ADK)

    +
    - -

    Purpose

    -
    -

    Amazon CodeCatalyst provides software development teams one place to plan work, collaborate on code, and build, test, and deploy applications with continuous integration/continuous delivery (CI/CD) tools. For more information, see What is Amazon CodeCatalyst?

    -

    With the CodeCatalyst Action Development Kit (ADK), you can build, test, and publish actions to the CodeCatalyst actions catalog, where other users can add them to workflows. This ADK provides tooling and support to help you develop actions using libraries and frameworks.

    -

    In CodeCatalyst, an action is the main building block of a workflow. The actions you author define a logical unit of work to perform during a workflow run. By creating actions and workflows, you can automate procedures that describe how to build, test, and deploy your code as part of a continuous integration and continuous delivery (CI/CD) system. For more information, see Working with actions.

    + +

    Purpose

    +
    +

    + Amazon CodeCatalyst provides software development teams one place to plan work, collaborate on code, and build, test, and deploy + applications with continuous integration/continuous delivery (CI/CD) tools. For more information, see + What is Amazon CodeCatalyst? +

    +

    + With the CodeCatalyst Action Development Kit (ADK), you can build, test, and publish actions to the CodeCatalyst actions catalog, where + other users can add them to workflows. This ADK provides tooling and support to help you develop actions using libraries and frameworks. +

    +

    + In CodeCatalyst, an action is the main building block of a workflow. The actions you author define a logical unit of work to perform + during a workflow run. By creating actions and workflows, you can automate procedures that describe how to build, test, and deploy your + code as part of a continuous integration and continuous delivery (CI/CD) system. For more information, see + Working with actions. +

    - -

    ADK Components

    -
    -

    There are two components of the ADK:

    -
      -
    1. ADK software development kit (SDK)
    2. -
    -

    A set of library interfaces you can use to interact with action matadata and CodeCatalyst resources, including actions, workflows, secrets, logs, input variables, output variables, artifacts, and reports.

    + +

    ADK Components

    +
    +

    There are two components of the ADK:

    +
      +
    1. ADK software development kit (SDK)
    2. +
    +

    + A set of library interfaces you can use to interact with action matadata and CodeCatalyst resources, including actions, workflows, + secrets, logs, input variables, output variables, artifacts, and reports. +

    - -

    Sample Usage

    -
    -
    // @ts-ignore
    import * as core from '@aws/codecatalyst-adk-core';
    // @ts-ignore
    import * as project from '@aws/codecatalyst-project';
    // @ts-ignore
    import { RunSummaryLevel, RunSummaries } from '@aws/codecatalyst-run-summaries';
    // @ts-ignore
    import * as space from '@aws/codecatalyst-space';

    const destinationBucket = core.getInput('DestinationBucketName')
    # => Maps to the destination bucket configuration in CodeCatalyst workflow definition
    const srcDir = core.getInput('SourcePath')
    # => Maps to the src dir configuration in CodeCatalyst workflow definition
    console.log("Running action S3 Publish Action")
    let cmd = `aws s3 sync ${srcDir} s3://${destinationBucket}/${space.getSpace().name}/${project.getProject().name}/`
    const cmdOutput = core.command(cmd)
    console.log(cmdOutput.stdout)

    if (cmdOutput.code != 0) {
    core.setFailed(cmdOutput.stderr)
    } else {
    core.setOutputVariable("Files", cmdOutput.stdOut)
    } + +

    Sample Usage

    +
    +
    // @ts-ignore
    import * as core from '@aws/codecatalyst-adk-core';
    // @ts-ignore
    import * as project from '@aws/codecatalyst-project';
    // @ts-ignore
    import { RunSummaryLevel, RunSummaries } from '@aws/codecatalyst-run-summaries';
    // @ts-ignore
    import * as space from '@aws/codecatalyst-space';

    const destinationBucket = core.getInput('DestinationBucketName')
    # => Maps to the destination bucket configuration in CodeCatalyst workflow definition
    const srcDir = core.getInput('SourcePath')
    # => Maps to the src dir configuration in CodeCatalyst workflow definition
    console.log("Running action S3 Publish Action")
    let cmd = `aws s3 sync ${srcDir} s3://${destinationBucket}/${space.getSpace().name}/${project.getProject().name}/`
    const cmdOutput = core.command(cmd)
    console.log(cmdOutput.stdout)

    if (cmdOutput.code != 0) {
    core.setFailed(cmdOutput.stderr)
    } else {
    core.setOutputVariable("Files", cmdOutput.stdOut)
    }
    -
      -
    1. ADK command line interface (CLI)
    2. -
    -

    Tool to interact with a set of commands you can use to create, validate, and test actions.

    +
      +
    1. ADK command line interface (CLI)
    2. +
    +

    Tool to interact with a set of commands you can use to create, validate, and test actions.

    - -

    Sample Usage

    -
    -
    >> adk init --lang typescript --space <CODECATALYST-SPACE-NAME> --proj <CODECATALYST-PROJECT-NAME> --repo <CODECATALYST-REPO-NAME> --action <ACTION-NAME>
    ...

    >> adk bootstrap
    ...

    >> adk validate
    validating...
    Missing README file...
    action.yml parsing failed... + +

    Sample Usage

    +
    +
    >> adk init --lang typescript --space <CODECATALYST-SPACE-NAME> --proj <CODECATALYST-PROJECT-NAME> --repo <CODECATALYST-REPO-NAME> --action <ACTION-NAME>
    ...

    >> adk bootstrap
    ...

    >> adk validate
    validating...
    Missing README file...
    action.yml parsing failed...
    -

    The following list contains the ADK CLI commands and information about how to use each command:

    -
      -
    • init – Initializes the ADK project locally and produces required configuration files with specific language support.
    • -
    • bootstrap – Bootstraps CodeCatalyst action code by reading the action definition file. The ADK SDK is used to develop actions.
    • -
    • validate – Validates the action definition and README file.
    • -
    • version – Returns the current version of ADK.
    • -
    • help – Shows the current set of commands.
    • -
    +

    The following list contains the ADK CLI commands and information about how to use each command:

    +
      +
    • init – Initializes the ADK project locally and produces required configuration files with specific language support.
    • +
    • bootstrap – Bootstraps CodeCatalyst action code by reading the action definition file. The ADK SDK is used to develop actions.
    • +
    • validate – Validates the action definition and README file.
    • +
    • version – Returns the current version of ADK.
    • +
    • help – Shows the current set of commands.
    • +
    - -

    Installation Guide

    -
    + +

    Installation Guide

    +
    - -

    Prerequisites

    -
    -
      -
    1. Download the latest version of npm. It is best to use a Node version manager like nvm to install Node.js and npm.
    2. -
    3. Run the following Lerna command: npm install -g lerna.
        -
      • Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.
      • -
      -
    4. -
    5. Run the following command to install yarn: npm install --global yarn
        -
      • Yarn is a package manager that doubles down as project manager. You can you work on one-shot projects or large monorepos, as a hobbyist or an enterprise user.
      • -
      -
    6. -
    + +

    Prerequisites

    +
    +

    + Download the latest version of npm. It is best to use a + Node version manager like nvm to install Node.js and npm. +

    +
    yarn
    yarn build +
    - -

    Install ADK CLI

    -
    -
      -
    1. Run the following npm command to install the ADK CLI package globally:

      -
        -
      • npm install -g @aws/codecatalyst-adk
      • -
      -
    2. -
    3. Validate that ADK is running with the following command: adk help

      -
    4. -
    + +

    Install ADK CLI

    +
    +
      +
    1. +

      Run the following npm command to install the ADK CLI package globally:

      +
        +
      • npm install -g @aws/codecatalyst-adk
      • +
      +
    2. +
    3. +

      Validate that ADK is running with the following command: adk help

      +
    4. +
    - -

    Development

    -
    + +

    Development

    +
    - -

    Build

    -
    -

    Run the following build command:

    -
    $ ./build.sh
    +          
    +            

    Build

    +
    +

    Run the following build command:

    +
    yarn build
     
    - -

    Testing

    -
    -

    Run the following test command:

    -
    $ yarn run test-all
    +          
    +            

    Testing

    +
    +

    Run the following test command:

    +
    yarn test
     
    - -

    Contribute

    -
    -

    You can contribute to the ADK by completing development on a feature branch and creating a pull request:

    -
      -
    • Create a branch from main and name it feature-* branch (e.g. feature-add-init-command). Creating the feature branch creates CI validation workflow against the feature- branch.
    • -
    • Update the code in your new branch feature-*.
    • -
    • Once you're done with feature development, create a pull request from source feature-* branch to destination main branch. This triggers a CI workflow in yourfeature-* branch. Update the pull request with the workflow run in the description section of the pull request.
    • -
    • Add reviewers from the reviewer section. Reviewers can be anyone within the organization, but at least one must be a developer from the AEF team.
    • -
    • Once you have all the approvals in your pull request, merge the pull request from the UI by choosing squash (not fast forward merge) and reducing the number of commits to just one from the feature branch. This makes rollbacks easy if you have one commit per feature branch. If you have large amount of changes in your pull request, it's best to rethink your development strategy to iteratively develop and push code.
    • -
    • On merge, release workflows within the ADK repository will kick-off. This should automatically bump the version of the ADK package for consumption.
    • -
    + +

    Contribute

    +
    +

    You can contribute to the ADK by completing development on a feature branch and creating a pull request:

    +
      +
    • + Create a branch from main and name it feature-* branch (e.g. + feature-add-init-command). Creating the feature branch creates CI validation workflow against the feature- branch. +
    • +
    • Update the code in your new branch feature-*.
    • +
    • + Once you're done with feature development, create a pull request from source feature-* branch to destination main + branch. This triggers a CI workflow in yourfeature-* branch. Update the pull request with the workflow run in the + description section of the pull request. +
    • +
    • + Add reviewers from the reviewer section. Reviewers can be anyone within the organization, but at least one must be a developer from the + AEF team. +
    • +
    • + Once you have all the approvals in your pull request, merge the pull request from the UI by choosing squash (not fast forward merge) and + reducing the number of commits to just one from the feature branch. This makes rollbacks easy if you have one commit per feature branch. + If you have large amount of changes in your pull request, it's best to rethink your development strategy to iteratively develop and + push code. +
    • +
    • + On merge, release workflows within the ADK repository will kick-off. This should automatically bump the version of the ADK package for + consumption. +
    • +
    - -

    Test Coverage Expectations

    -
    -
      -
    • branches: 90%
    • -
    • statements: 90%
    • -
    • functions: 90%
    • -
    • lines: 90%
    • -
    + +

    Test Coverage Expectations

    +
    +
      +
    • branches: 90%
    • +
    • statements: 90%
    • +
    • functions: 90%
    • +
    • lines: 90%
    • +
    - -

    ChangeLog

    -
    -

    Changelog

    + +

    ChangeLog

    +
    +

    Changelog

    - -

    Security

    -
    -

    See CONTRIBUTING for more information.

    + +

    Security

    +
    +

    See CONTRIBUTING for more information.

    - -

    License

    -
    -

    This project is licensed under the Apache-2.0 License.

    -
    -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file + +

    License

    +
    +

    This project is licensed under the Apache-2.0 License.

    +
    +
    + +
    +
    +

    Generated using TypeDoc

    +
    +
    + + + diff --git a/docs/interfaces/_aws_codecatalyst_adk_core.ICommandOutput.html b/docs/interfaces/_aws_codecatalyst_adk_core.ICommandOutput.html index 9cf13a18f..192c7e557 100644 --- a/docs/interfaces/_aws_codecatalyst_adk_core.ICommandOutput.html +++ b/docs/interfaces/_aws_codecatalyst_adk_core.ICommandOutput.html @@ -68,8 +68,8 @@

    Hierarchy

    @@ -157,8 +157,8 @@

    Indexable

    diff --git a/docs/interfaces/_aws_codecatalyst_adk_model_parser.Environment.html b/docs/interfaces/_aws_codecatalyst_adk_model_parser.Environment.html index 64779e5dd..87de3d573 100644 --- a/docs/interfaces/_aws_codecatalyst_adk_model_parser.Environment.html +++ b/docs/interfaces/_aws_codecatalyst_adk_model_parser.Environment.html @@ -75,8 +75,8 @@

    Hierarchy

    @@ -153,8 +153,8 @@

    Hierarchy

    @@ -178,8 +178,8 @@

    Hierarchy

    @@ -197,8 +197,8 @@

    Hierarchy

    @@ -162,8 +162,8 @@

    Hierarchy

    @@ -153,8 +153,8 @@

    Hierarchy

    @@ -157,8 +157,8 @@

    Hierarchy

    @@ -174,8 +174,8 @@

    Hierarchy

    @@ -183,8 +183,8 @@

    Hierarchy

    @@ -154,8 +154,8 @@

    Hierarchy

    @@ -157,8 +157,8 @@

    Module @aws/codecatalyst-adk

    diff --git a/docs/modules/_aws_codecatalyst_adk_core.html b/docs/modules/_aws_codecatalyst_adk_core.html index 7e5a3ae4b..3dfebe85f 100644 --- a/docs/modules/_aws_codecatalyst_adk_core.html +++ b/docs/modules/_aws_codecatalyst_adk_core.html @@ -58,9 +58,7 @@

    Module @aws/codecatalyst-adk-core

    @@ -178,6 +176,12 @@

    Functions

    getInput + + + getInputParam Functions

    getMultiLineInput + + + runCommand setFailed + + + setFailure setOutput + + + setOutputParam + + + validateInput

    @@ -397,6 +425,14 @@

    >getInput +
  • + + + getInputParam +
  • @@ -405,6 +441,14 @@

    >getMultiLineInput

  • +
  • + + + runCommand +
  • @@ -413,6 +457,14 @@

    >setFailed

  • +
  • + + + setFailure +
  • @@ -421,6 +473,22 @@

    >setOutput

  • +
  • + + + setOutputParam +
  • +
  • + + + validateInput +
  • diff --git a/docs/modules/_aws_codecatalyst_adk_model_parser.html b/docs/modules/_aws_codecatalyst_adk_model_parser.html index 191aa3ae5..0ff8fe372 100644 --- a/docs/modules/_aws_codecatalyst_adk_model_parser.html +++ b/docs/modules/_aws_codecatalyst_adk_model_parser.html @@ -58,8 +58,8 @@

    Module @aws/codecatalyst-adk-model-parser

    diff --git a/docs/modules/_aws_codecatalyst_adk_utils.html b/docs/modules/_aws_codecatalyst_adk_utils.html index 87b374177..6aee68d71 100644 --- a/docs/modules/_aws_codecatalyst_adk_utils.html +++ b/docs/modules/_aws_codecatalyst_adk_utils.html @@ -57,7 +57,8 @@

    Module @aws/codecatalyst-adk-utils

    diff --git a/docs/modules/_aws_codecatalyst_project.html b/docs/modules/_aws_codecatalyst_project.html index dd92b1d00..93bd90391 100644 --- a/docs/modules/_aws_codecatalyst_project.html +++ b/docs/modules/_aws_codecatalyst_project.html @@ -58,8 +58,8 @@

    Module @aws/codecatalyst-project

    diff --git a/docs/modules/_aws_codecatalyst_run_summaries.html b/docs/modules/_aws_codecatalyst_run_summaries.html index a683c4a23..555c106a8 100644 --- a/docs/modules/_aws_codecatalyst_run_summaries.html +++ b/docs/modules/_aws_codecatalyst_run_summaries.html @@ -58,8 +58,8 @@

    Module @aws/codecatalyst-run-summaries

    @@ -83,7 +83,7 @@

    Usage

       import { RunSummaryLevel, RunSummaries } from '@aws/codecatalyst-run-summaries';

    try {
    // execute action code here
    } catch (error) {
    // Since we want to surface an error, we use RunSummaryLevel.ERROR to specify this is an error
    RunSummaries.addRunSummary(error, RunSummaryLevel.ERROR)
    }
    -
       import { RunSummaryLevel, RunSummaries } from '@aws/codecatalyst-run-summaries';
    import * as adkCore from '@aws/codecatalyst-adk-core';

    const cmdOutput = adkCore.command(/* command here */)
    // if the exit code of the command is a failure
    if (cmdOutput.code != 0)
    // pass the error message of the command as the summary message text
    RunSummaries.addRunSummary(cmdOutput.stderr.toString(), RunSummaryLevel.ERROR)
    } +
       import { RunSummaryLevel, RunSummaries } from '@aws/codecatalyst-run-summaries';
    import * as adkCore from '@aws/codecatalyst-adk-core';

    const cmdOutput = adkCore.command(/* command here */)
    // if the exit code of the command is a failure
    if (cmdOutput.code != 0)
    // pass the error message of the command as the summary message text
    RunSummaries.addRunSummary(cmdOutput.stderr.toString(), RunSummaryLevel.ERROR)
    }
    diff --git a/docs/modules/_aws_codecatalyst_space.html b/docs/modules/_aws_codecatalyst_space.html index 6da14d30e..0d1d4ac69 100644 --- a/docs/modules/_aws_codecatalyst_space.html +++ b/docs/modules/_aws_codecatalyst_space.html @@ -58,9 +58,7 @@

    Module @aws/codecatalyst-space

    diff --git a/docs/variables/_aws_codecatalyst_adk_utils.outputVariableNamePattern.html b/docs/variables/_aws_codecatalyst_adk_utils.outputVariableNamePattern.html index 840596e91..ab8256d14 100644 --- a/docs/variables/_aws_codecatalyst_adk_utils.outputVariableNamePattern.html +++ b/docs/variables/_aws_codecatalyst_adk_utils.outputVariableNamePattern.html @@ -63,7 +63,9 @@

    Variable outputVariableNamePatternConst
  • Defined in - adk-utils/lib/util/util.ts:3 + adk/adk-utils/src/util/util.ts:3
  • diff --git a/typedoc.js b/typedoc.js index 6811c3550..28dfe3eef 100644 --- a/typedoc.js +++ b/typedoc.js @@ -1,12 +1,12 @@ module.exports = { entryPointStrategy: "packages", entryPoints: [ - "packages/adk", - "packages/adk-core", - "packages/adk-model-parser", - "packages/adk-utils", - "packages/run-summaries", - "packages/project", - "packages/space", + "packages/adk/adk", + "packages/adk/adk-core", + "packages/adk/adk-model-parser", + "packages/adk/adk-utils", + "packages/entities/run-summaries", + "packages/entities/project", + "packages/entities/space", ] } From 5e293c1b11481c575ed784bf30537a9f3e57f5c8 Mon Sep 17 00:00:00 2001 From: Andres Jardon Date: Fri, 26 Jan 2024 15:55:27 -0800 Subject: [PATCH 10/11] Add projenified release workflow to publish to NPM --- .github/workflows/Publish-To-NPM.yml | 96 ++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/workflows/Publish-To-NPM.yml diff --git a/.github/workflows/Publish-To-NPM.yml b/.github/workflows/Publish-To-NPM.yml new file mode 100644 index 000000000..9a460cc7c --- /dev/null +++ b/.github/workflows/Publish-To-NPM.yml @@ -0,0 +1,96 @@ +# This workflow will build and run tests using node and then publish a package to the public NPM repository +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Publish-To-NPM + +on: [workflow_dispatch] + +env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SSH_PUBLIC_KEY: ${{ secrets.SSH_PUBLIC_KEY }} + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + GIT_COMMITTER_NAME: ActionsDevKitRelease + GIT_COMMITTER_EMAIL: cawsactionextensions+adk-release@amazon.com + +jobs: + release-to-prod: + runs-on: ubuntu-latest + permissions: write-all + steps: + # Allows to push to the main branch for + - name: Git & SSH auth setup + run: | + sudo git config --system --add safe.directory "*" + if [[ -n $SSH_PUBLIC_KEY && -n $SSH_PRIVATE_KEY ]]; then + echo "SSH Key pair found, configuring signing..." + mkdir ~/.ssh + echo -e "$SSH_PRIVATE_KEY" >> ~/.ssh/signing_key + cat ~/.ssh/signing_key + echo -e "$SSH_PUBLIC_KEY" >> ~/.ssh/signing_key.pub + cat ~/.ssh/signing_key.pub + chmod 600 ~/.ssh/signing_key && chmod 600 ~/.ssh/signing_key.pub + eval "$(ssh-agent)" + ssh-add ~/.ssh/signing_key + git config --global gpg.format ssh + git config --global user.signingKey ~/.ssh/signing_key + git config --global commit.gpgsign true + git config --global user.email $GIT_COMMITTER_EMAIL + git config --global user.name $GIT_COMMITTER_NAME + touch ~/.ssh/allowed_signers + echo "$GIT_COMMITTER_EMAIL $SSH_PUBLIC_KEY" > ~/.ssh/allowed_signers + git config --global gpg.ssh.allowedSignersFile ~/.ssh/allowed_signers + fi + # Checkout main branch + - uses: actions/checkout@v4 + with: + # Checkout with ssh key to be able to push changes back to the branch. + # The expected changes are: + # - a version bump in the package.json files + # - New commit that begins with chore(release): + # - New tag for the new version release + ssh-key: ${{ env.SSH_PRIVATE_KEY }} + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v4 + with: + node-version: 18 + registry-url: 'https://registry.npmjs.org/' + cache: 'yarn' + scope: '@aws' + # Install dependencies + - run: npm install -g npm@6.14.13 + - run: yarn --version + - run: npm --version + + # Yarn Install + - run: yarn --immutable-cache + + # Build project (also runs tests and packages dist) See packages/adk/adk-utils/.projen/tasks.json + - run: yarn build + + # Bump all package versions + - run: yarn projen bump + - run: NEW_ADK_RELEASE_VERSION=`jq -r .version packages/adk/adk/package.json` + - run: NEW_WORKFLOWS_SDK_RELEASE_VERSION=`jq -r .version packages/workflows/workflows-sdk/package.json` + + # Add and show changes + - run: git add . + - run: git status + + + # Commit changes and create new version tag + - run: RELEASE_COMMIT_MESSAGE="chore(release): release ADK v$NEW_ADK_RELEASE_VERSION and workflows-sdk v$NEW_WORKFLOWS_SDK_RELEASE_VERSION" + - run: git commit -m "$RELEASE_COMMIT_MESSAGE" + - run: git tag -a v$NEW_ADK_RELEASE_VERSION HEAD -m "$RELEASE_COMMIT_MESSAGE" + + # Push commits and tag + - run: git push origin HEAD:main + - run: git push origin v$NEW_ADK_RELEASE_VERSION + + # Ensure changes are up to date + - run: git status + - run: git pull + + # Publishes packages to NPM https://www.npmjs.com/~adk-npm-public-release + - run: yarn projen npm:publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 328e780ecb75f0cdcb86e1411bcd0adcf5881a4c Mon Sep 17 00:00:00 2001 From: Andres Jardon <119068809+aj-aws@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:09:43 -0800 Subject: [PATCH 11/11] Update Publish-To-NPM.yml --- .github/workflows/Publish-To-NPM.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Publish-To-NPM.yml b/.github/workflows/Publish-To-NPM.yml index 9a460cc7c..2c3e4527e 100644 --- a/.github/workflows/Publish-To-NPM.yml +++ b/.github/workflows/Publish-To-NPM.yml @@ -78,7 +78,7 @@ jobs: # Commit changes and create new version tag - - run: RELEASE_COMMIT_MESSAGE="chore(release): release ADK v$NEW_ADK_RELEASE_VERSION and workflows-sdk v$NEW_WORKFLOWS_SDK_RELEASE_VERSION" + - run: RELEASE_COMMIT_MESSAGE="chore(release) release ADK v$NEW_ADK_RELEASE_VERSION and workflows-sdk v$NEW_WORKFLOWS_SDK_RELEASE_VERSION" - run: git commit -m "$RELEASE_COMMIT_MESSAGE" - run: git tag -a v$NEW_ADK_RELEASE_VERSION HEAD -m "$RELEASE_COMMIT_MESSAGE"