Set Component Info

Action ID: harmonix:get-component-info
NPM Package:

@aws/plugin-scaffolder-backend-aws-apps-for-backstage

Description

Sets useful component info for other actions to use

Input Schema

PropertyTypeDescriptionRequired
componentNamestring-

Output Schema

PropertyTypeDescriptionRequired
kebabCaseComponentNamestring-

Usage Examples

Generate a kebab-case component ID and use it to scaffold into a named directory

This example converts the provided component name to kebab-case, then uses it to set the target directory and template values. Use this when you want consistent directory and ID naming. It pairs well with fetch:template.

Copy
steps:
  - id: componentInfo
    action: harmonix:get-component-info
    input:
      componentName: ${{ parameters.componentName }}

  - id: fetchBase
    action: fetch:template
    input:
      url: ./skeleton
      targetPath: ./services/${{ steps.componentInfo.output.kebabCaseComponentName }}
      values:
        componentName: ${{ parameters.componentName }}
        component_id: ${{ steps.componentInfo.output.kebabCaseComponentName }}
        owner: ${{ parameters.owner }}
        description: ${{ parameters.description }}

Build a kebab-case name from multiple inputs for package and image naming

This example composes the component name from system and service inputs, then uses the kebab-case output for package and image names. Use this when you want a consistent naming pattern across packages and container images. It follows with fetch:template.

Copy
steps:
  - id: compInfo
    action: harmonix:get-component-info
    input:
      componentName: "${{ parameters.system }}-${{ parameters.serviceName }}"

  - id: materialize
    action: fetch:template
    input:
      url: ./node-service-template
      targetPath: ./services/${{ steps.compInfo.output.kebabCaseComponentName }}
      values:
        serviceName: ${{ parameters.serviceName }}
        system: ${{ parameters.system }}
        packageName: "@acme/${{ steps.compInfo.output.kebabCaseComponentName }}"
        imageName: "ghcr.io/acme/${{ steps.compInfo.output.kebabCaseComponentName }}:latest"
        component_id: ${{ steps.compInfo.output.kebabCaseComponentName }}