st2docs icon indicating copy to clipboard operation
st2docs copied to clipboard

Use of env variable for actions has no example

Open bkk-bcd opened this issue 3 years ago • 1 comments

There's no documentation on how to override a runners env: https://docs.stackstorm.com/actions.html#built-in-parameters

Is there a schema available for the YAML?

And the obvious choices seem to not work:

name: run_build
pack: builder
runner_type: "local-shell-cmd"
description: Run build for project and branch.
enabled: true
parameters:
  env:
    var1: "val1"
  cmd:
    immutable: true
    default: 'builder build --repo {{repo}} --branch {{branch}}'
  repo:
    type: string
    description: Github repo for project.
    required: true
  branch:
    type: string
    description: Branch to run the build on.
  sha1:
    type: string
    description: Sha1 on branch to run the build on.
  build_parameters:
    type: object
    description: k-v pair (k1=v1,k2=v2) of parameters to pass to build.
name: run_build
pack: builder
runner_type: "local-shell-cmd"
description: Run build for project and branch.
enabled: true
env:
  var1: "val1"
parameters:
  cmd:
    immutable: true
    default: 'builder build --repo {{repo}} --branch {{branch}}'
  repo:
    type: string
    description: Github repo for project.
    required: true
  branch:
    type: string
    description: Branch to run the build on.
  sha1:
    type: string
    description: Sha1 on branch to run the build on.
  build_parameters:
    type: object
    description: k-v pair (k1=v1,k2=v2) of parameters to pass to build.

bkk-bcd avatar Aug 18 '21 15:08 bkk-bcd

There are examples of overriding parameters in the next section down: https://docs.stackstorm.com/actions.html#overriding-runner-parameters

None of those override env specifically though. Some examples of that might help.

blag avatar Aug 18 '21 16:08 blag