pipeline:
  name: boost
  identifier: boost
  variables:
    - name: scan_params
      type: String
      required: true
      value: <+input>
  stages:
    - stage:
        name: Boost Scanner
        identifier: boost_scanner
        type: CI
        spec:
          cloneCodebase: false
          platform:
            os: Linux
            arch: Amd64
          runtime:
            type: Cloud
            spec: {}
          execution:
            steps:
              - step:
                  type: Run
                  name: Run Boost Scanner
                  identifier: run_boost_scanner
                  spec:
                    shell: Sh
                    envVariables:
                      BOOST_API_TOKEN: <+secrets.getValue('BOOST_API_TOKEN')>
                      SCAN_PARAMS: <+pipeline.variables.scan_params>
                    command: |-
                      set -e
                      curl -s https://assets.build.boostsecurity.io/boost-cli/get-boost-cli | sh
                      TRIGGER_ID=$(printf '%s' "$SCAN_PARAMS" | jq -r .trigger_id)
                      /tmp/boost-cli/latest scan trigger --trigger-id "$TRIGGER_ID"
