name: Trigger Run

on:
  workflow_dispatch:
    inputs:
      templateId:
        description: "the templateId"
        required: true
        type: string
      parametersJson:
        description: "parameters as json to be provided to the template"
        type: string

jobs:
  build-and-release:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Code
        uses: actions/checkout@v3

      - name: Set up Node.js
        uses: actions/setup-node@v3
        with:
          node-version: "20" # Specify the Node.js version
          cache: "yarn"

      - name: Install Dependencies
        run: yarn install

      - name: Run Compass Scaffolder
        run: npx compass-scaffolder run ${{ inputs.templateId }} ${{ inputs.parametersJson }}
        env:
          NODE_OPTIONS: "--no-node-snapshot"
