Skip to content

GitHub Output

Write TenXObject instance values to a remote file on GitHub.

This output allows pipelines to dynamically generate YAML configuration and text lookup files.

Subsequent pipeline instances can pull generated files from GitHub to guide their execution.

Availability

This implementation is only available by default in the 10x Engine Cloud flavor to reduce the footprint of the edge/JIT-edge flavors.

Configuration

To configure the GitHub output module, Edit these settings.

Below is the default configuration from: github/config.yaml (* Required Fields).

Edit Online

Edit config.yaml Locally

# 🔟❎ 'run' GitHub output configuration

# Write TenXObjects instance values to a remote file on GitHub.
# To learn more see https://doc.log10x.com/run/output/event/github/

# Set the 10x pipeline to 'run'
tenx: run

# =============================== Dependencies ================================

include:
  - run/modules/output/event/github

# ============================== Output Options ===============================

# Multiple GitHub outputs can be defined below
githubOutput:

  # ---------------------------- GitHub Options -------------------------------

    # 'authToken' specifies the GitHub API with which to authenticate
  - token: $=yield TenXEnv.get("GH_TOKEN")

    # 'repo' specifies the name of the target repo (e.g., user/repo)
    repo: null # (❗ REQUIRED)

    # 'branch' specifies the target branch into which to commit. Default to main repo branch.
    branch: null

    # 'path' specifies the path of artifact within the target repo to update.
    path: null

    # 'header' specifies as header value to write to the output file (e.g., lookup columns row, YAML comments)
    header: null

    # 'message'  specifies a commit message for this update
    message: null

    # 'pullRequestBody' specifies the body of the pull request used to commit and merge the target file
    pullRequestBody: null

    # 'squashMerge' specifies whether to use squash merge (true) or regular merge (false) when merging pull requests
    #  Squash merge combines all commits into one, keeping commit history clean. Useful for frequent automated commits.
    squashMerge: false

    # --------------------------- Encoding Options ----------------------------

    # 'filter' sets a JavaScript expression that TenXObjects must evaluate as truthy to write to the output.
    #  To learn more see https://doc.log10x.com/run/output/regulate/#filter-expressions
    filter: isObject

    # 'fields' defines the fields to write for each TenXObject sent to this output.
    #  To learn more see https://doc.log10x.com/run/output/stream/#outputfields

    fields:
      - encode()

    # 'encodeType' specifies how 'fields' are encoded to output. Possible values: [json,delimited].
    #  To learn more see https://doc.log10x.com/run/output/event/outputStream/#outputstreamencodetype
    encodeType: json

Options

Specify the options below to configure multiple GitHub output:

Name Description Category
githubOutputToken GitHub API auth token Github
githubOutputRepo Name of target repo Github
githubOutputBranch Target branch into which to commit Github
githubOutputPath Path of artifact within the target repo to update Github
githubOutputHeader Header value to write to output Github
githubOutputMessage Commit message for target file Github
githubOutputPullRequestBody Pull request message for target file Github
githubOutputSquashMerge Use squash merge when merging pull requests Github
githubOutputFields List of TenXObject field names to encode Encoding
githubOutputFilter A JavaScript expression an TenXObject must evaluate as 'truthy' against to be written to this output Encoding
githubOutputEncodeType The output format in which to encode TenXObject values. Possible values:[json, delimited] Encoding
githubOutputEncodedLinePrefix The line prefix prepended to the encoded event if 'githubOutputEncodeType' is 'delimited' Encoding
githubOutputEncodeDelimiter The delimiter placed between key and values pairs if 'githubOutputEncodeType' is 'delimited' Encoding

Github

githubOutputToken

GitHub API auth token.

Type Required Category
String Github

Specifies the GitHub API with which to authenticate. To learn more see GitHub tokens.

githubOutputRepo

Name of target repo.

Type Required Category
String Github

Specifies the name of the target repo (e.g., user/repo).

githubOutputBranch

Target branch into which to commit.

Type Default Category
String repo default branch Github

Specifies the name of the target repo branch.

githubOutputPath

Path of artifact within the target repo to update.

Type Required Category
String Github

Specifies the path within the target repo and branch to update.

githubOutputHeader

Header value to write to output.

Type Default Category
String "" Github

Specifies as header value to write to the target path. This value can specify a header row when emitting a .csv/.tsv lookup file or a header comment value for a .yaml file.

githubOutputMessage

Commit message for target file.

Type Default Category
String auto-generated message Github

Specifies a commit message for this update.

githubOutputPullRequestBody

Pull request message for target file.

Type Default Category
String auto-generated message Github

Specifies the body of the pull request used to commit and merge the target file to the destination branch.

githubOutputSquashMerge

Use squash merge when merging pull requests.

Type Default Category
Boolean false Github

Specifies whether to use squash merge (true) or regular merge (false) when merging the pull request. Squash merge combines all commits into a single commit, resulting in a cleaner commit history. This is useful for automated commits that run frequently (e.g., GitOps policy updates).

Encoding

githubOutputFields

List of TenXObject field names to encode.

Type Default Category
List [] Encoding

Specifies a list of TenXObject intrinsic/calculated/extracted field names to extract and write to the output.

githubOutputFilter

A JavaScript expression an TenXObject must evaluate as 'truthy' against to be written to this output.

Type Default Category
String "" Encoding

Specifies a JavaScript expression that an TenXObject must evaluate as truthy to write its instance/template field values to this output.

For example, to only emit timestamped TenXObjects, specify:

githubOutputFilter: this.timestamped

githubOutputEncodeType

The output format in which to encode TenXObject values. Possible values:[json, delimited].

Type Default Category
String delimited Encoding

Specifies how to encode githubOutputFields values to this output. Possible values:

  • json: formats names and values for the current TenXObject as: {"field":"str","field2":1, "field3": true}
  • delimited: formats values for the current TenXObject as: "str",1,true The 'githubOutputEncodeDelimiter' argument determines the separator to use.

githubOutputEncodedLinePrefix

The line prefix prepended to the encoded event if 'githubOutputEncodeType' is 'delimited'.

Type Default Category
String Encoding

Sets the char which is prepended to the emitted TenXObject field values when githubOutputEncodeType is delimited.

githubOutputEncodeDelimiter

The delimiter placed between key and values pairs if 'githubOutputEncodeType' is 'delimited'.

Type Default Category
String Encoding

Sets the char delimiter to separate TenXObject field values when githubOutputEncodeType is 'delimited'.


This module is defined in github/module.yaml.