Skip to content

Organization Variable

Definition of a Variable on organization level, the following properties are supported:

Key Value Description Note
name string The name of the variable
selected_repositories list[string] List of repositories that can use the variable only applicable if visibility is set to selected
value string The variable value
visibility string Controls which repositories can use the variable public, private or selected

Jsonnet Function

orgs.newOrgVariable('<name>') {
  <key>: <value>
}

Validation rules

  • visibility of private is not supported by GitHub with a billing plan of type free
  • specifying a non-empty list of selected_repositories while visibility is not set to selected triggers a warning

Example usage

orgs.newOrg('OtterdogTest') {
  ...
  variables+: [
    orgs.newOrgVariable('TEST_VARIABLE') {
      selected_repositories+: [
        "test-repo"
      ],
      value: "MYVALUE",
      visibility: "selected",
    },
  ],
  ...
}