@aws/codecatalyst-run-summaries

1.0.20 • Public • Published

@aws/codecatalyst-run-summaries

Purpose

Use the run-summaries construct to set custom summary messages during the execution of actions that will be surfaced on the CodeCatalyst workflows UI.

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)
   }

Readme

Keywords

none

Package Sidebar

Install

npm i @aws/codecatalyst-run-summaries

Weekly Downloads

8,064

Version

1.0.20

License

Apache-2.0

Unpacked Size

17.7 kB

Total Files

11

Last publish

Collaborators

  • adk-npm-public-release
  • koshlap