---
icon: material/github
---

The 10x Engine employs a [GitOps](https://doc.log10x.com/engine/gitops/) approach to configuration management, offering a secure, version-controlled solution across distributed environments.

The `@github` launch macro enables the engine to pull YAML config, JavaScript, text/geo lookup, and Symbol library files from GitHub at startup.

The engine can poll the remote branch for changes at a specified interval (e.g., 5min),
allowing distributed 10x apps to synchronize and reload updated configurations.

Pulled files are extracted to a temporary directory (archives are automatically unpacked).

!!! tenx-k8sinitializer "k8s"

    When deploying 10x apps to k8s, the provided Helm charts can use [init containers](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/){target="_blank"}
    to pull configuration from GitHub, enabling container immutability.

    To learn more, see the deployment procedure for your specific app under [apps](https://doc.log10x.com/apps/).

### :simple-yaml: Config

To specify a `@GitHub` launch macro via a [YAML](https://doc.log10x.com/config/yaml/) config file:

``` yaml
include:

tenx: run

- source: github

  options:

    # 'enabled' controls whether to enable this pull config
    enabled: true

    # 'token' specifies an access token for accessing the Github repo.
    #  To learn more see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
    token: $=TenXEnv.get("GH_TOKEN")

    # 'repo' specifies the GitHub user/repo name from which to pull files
    repo: my-user/my-repo

    # 'branch' on 'repo' (if null, use repo default branch)
    branch: main

     # 'paths' specifies Glob patterns within 'repo' to pull and extract to a temp folder.
    paths:
      - config/*.yaml     # https://doc.log10x.com/config/yaml
      - symbols/*.10x.tar # https://doc.log10x.com/run/symbol
      - lookups/*.csv     # https://doc.log10x.com/api/js/#TenXLookup
      - scripts/*.js      # https://doc.log10x.com/api/js/

    # 'syncInterval' specifies an interval by which to poll the remote branch for updates, set null for none.
    syncInterval: 5min
```

### :octicons-command-palette-24: CLI

You can specify a `@github` launch macro via the [CLI](https://doc.log10x.com/config/cli/)
as a JSON object by [bash-escaping](https://www.baeldung.com/linux/bash-escape-characters) its contents.

For example:

``` console
$ tenx run '@github={"token": "<replace-me-with-gh-token>", "repo": "my-user/my-repo", "branch": "main", "paths": ["config/*.yaml", "symbols/*.10x.tar", "lookups/*.csv", "scripts/*.js"], "syncInterval": "2min"}'
```
