Skip to content

Using a Configuration File

vzakaznikov edited this page Jan 23, 2024 · 1 revision

Instead of passing configuration options using command-line arguments, you can use configuration file. The configuration file uses YAML format, and it is usually named config.yaml. You can find the complete schema in schema.json.

✋ Note: When you mix command-line options with a custom configuration file, explicit command-line options take precedence over the values that are defined for the same parameters in the configuration file.

You can specify the default configuration by placing the configuration in the ~/.github-hetzner-runners/config.yaml file or pass the path to the configuration file explicitly using the -c path, --config path option.

The YAML configuration file supports special syntax to specify the value of a property as the value of the environment variable using the ${ENV_VAR_NAME} syntax.

For example,

github-hetzner-runners -c config.yaml

where,

config.yaml:
config:
   github_token: ${GITHUB_TOKEN}
   github_repository: ${GITHUB_REPOSITORY}
   hetzner_token: ${HETZNER_TOKEN}
   default_server_type: cx11
   cloud:
      server_name: "my-github-hetzner-runners-service"
   standby_runners:
      - labels:
         - type-cx21
        count: 2
        replenish_immediately: true
✋ Note:

This is a simple configuration file. You can find a complete example in the examples/config.yaml.

Clone this wiki locally