diff options
author | Josh Spicer <joshspicer@github.com> | 2022-06-22 21:51:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-22 21:51:23 +0300 |
commit | 43fd91f7b38f4ba8674ccafb10e8f392a0f433b4 (patch) | |
tree | 698b8deb64ed409d3cbc305da40737a49b7dd467 /.github/devcontainers-action/lib/main.js | |
parent | 6f107d547e2ee4d261bf45437294e9758e6027a2 (diff) |
no-ci - update action (generate features collection artifact)
Diffstat (limited to '.github/devcontainers-action/lib/main.js')
-rw-r--r-- | .github/devcontainers-action/lib/main.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/.github/devcontainers-action/lib/main.js b/.github/devcontainers-action/lib/main.js index c0327d7..2c0ea73 100644 --- a/.github/devcontainers-action/lib/main.js +++ b/.github/devcontainers-action/lib/main.js @@ -46,14 +46,17 @@ function run() { const shouldPublishFeatures = core.getInput('publish-features').toLowerCase() === 'true'; const shouldPublishTemplate = core.getInput('publish-templates').toLowerCase() === 'true'; const shouldGenerateDocumentation = core.getInput('generate-docs').toLowerCase() === 'true'; + let featuresMetadata = undefined; + let templatesMetadata = undefined; if (shouldPublishFeatures) { core.info('Publishing features...'); const featuresBasePath = core.getInput('base-path-to-features'); - yield packageFeatures(featuresBasePath); + featuresMetadata = yield packageFeatures(featuresBasePath); } if (shouldPublishTemplate) { core.info('Publishing template...'); const basePathToDefinitions = core.getInput('base-path-to-templates'); + templatesMetadata = undefined; // TODO yield packageTemplates(basePathToDefinitions); } if (shouldGenerateDocumentation) { @@ -69,20 +72,23 @@ function run() { } // 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)(); + yield (0, utils_1.addCollectionsMetadataFile)(featuresMetadata, templatesMetadata); }); } function packageFeatures(basePath) { return __awaiter(this, void 0, void 0, function* () { try { core.info(`Archiving all features in ${basePath}`); - yield (0, utils_1.getFeaturesAndPackage)(basePath); + const metadata = yield (0, utils_1.getFeaturesAndPackage)(basePath); core.info('Packaging features has finished.'); + return metadata; } catch (error) { - if (error instanceof Error) + if (error instanceof Error) { core.setFailed(error.message); + } } + return; }); } function packageTemplates(basePath) { |