diff options
Diffstat (limited to '.github/devcontainers-action/lib/main.js')
-rw-r--r-- | .github/devcontainers-action/lib/main.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/.github/devcontainers-action/lib/main.js b/.github/devcontainers-action/lib/main.js index 63d938e..2e5d391 100644 --- a/.github/devcontainers-action/lib/main.js +++ b/.github/devcontainers-action/lib/main.js @@ -33,12 +33,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(require("@actions/core")); +const generateDocs_1 = require("./generateDocs"); const utils_1 = require("./utils"); function run() { return __awaiter(this, void 0, void 0, function* () { core.debug('Reading input parameters...'); + // Read inputs const shouldPublishFeatures = core.getInput('publish-features').toLowerCase() === 'true'; const shouldPublishTemplate = core.getInput('publish-templates').toLowerCase() === 'true'; + const shouldGenerateDocumentation = core.getInput('generate-docs').toLowerCase() === 'true'; if (shouldPublishFeatures) { core.info('Publishing features...'); const featuresBasePath = core.getInput('base-path-to-features'); @@ -49,6 +52,17 @@ function run() { const basePathToDefinitions = core.getInput('base-path-to-templates'); yield packageTemplates(basePathToDefinitions); } + if (shouldGenerateDocumentation) { + core.info('Generating documentation...'); + const featuresBasePath = core.getInput('base-path-to-features'); + if (featuresBasePath) { + yield (0, generateDocs_1.generateFeaturesDocumentation)(featuresBasePath); + } + else { + core.error("'base-path-to-features' input is required to generate documentation"); + } + // TODO: base-path-to-templates + } // TODO: Programatically add feature/template fino with relevant metadata for UX clients. core.info('Generation metadata file: devcontainer-collection.json'); yield (0, utils_1.addCollectionsMetadataFile)(); |