Skip to content
align-justify

GitHub Action

jsonnet-render

v2 Latest version

jsonnet-render

align-justify

jsonnet-render

Executes jsonnet with provided args

Installation

Copy and paste the following snippet into your .yml file.

              

- name: jsonnet-render

uses: alexdglover/jsonnet-render@v2

Learn more about this action in alexdglover/jsonnet-render

Choose a version

jsonnet-render

Latest Release Examples

A GitHub action for executing Jsonnet. Typical usage will be to render Jsonnet files and combine them with another GitHub action to:

  • post the rendered result as a comment on a PR
  • create a pull request or new commit with the rendered files

Inputs

  • file - specifies the Jsonnet file to be rendered. REQUIRED
  • output_file - when set, writes the STDOUT from Jsonnet invocation to $output-file. OPTIONAL
  • output_dir - when set, appends -m $output_dir to the Jsonnet invocation to render multiple output files to a single directory. OPTIONAL
  • plaintext - when set to any value, Jsonnet is invoked with the -S flag to emit plaintext rather than JSON-encoded output.
  • params - specify external --ext-str arguments. dryrun=true env=prod becomes --ext-str dryrun=true --ext-str env=prod. Use either of comma, space or semicolon as argument separator. OPTIONAL

Output

This Action has no outputs.

Usage

Print to STDOUT

steps:
  - id: jsonnet-render
    uses: alexdglover/jsonnet-render@v2
    with:
      file: path/to/file.jsonnet

Render to file

steps:
  - id: jsonnet-render
    uses: alexdglover/jsonnet-render@v2
    with:
      file: path/to/file.jsonnet
      output_file: output/file.json
      params: dryrun=true env=prod

Render multiple files in a single directory

steps:
  - id: jsonnet-render
    uses: alexdglover/jsonnet-render@v2
    with:
      file: path/to/file.jsonnet
      output_dir: output/
      params: dryrun=true;env=prod