Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
zap

GitHub Action

Sling Run Action

v2

Sling Run Action

zap

Sling Run Action

Run a Sling command from Github Actions

Installation

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

              

- name: Sling Run Action

uses: slingdata-io/sling-action@v2

Learn more about this action in slingdata-io/sling-action

Choose a version

drawing

Slings from a data source to a data target.

How To Use

  1. Somewhere in your repo, create a Replication YAML file, something like this:
source: MY_POSTGRES
target: MY_SNOWFLAKE

# default config options which apply to all streams
defaults:
  mode: full-refresh # valid choices: incremental, truncate, full-refresh, snapshot

  # specify pattern to use for object naming in target connection, see below for options
  object: '{target_schema}.{stream_schema}_{stream_table}'

  # source_options: # optional for more advanced options for source connection
  # target_options: # optional for more advanced options for target connection

streams:
  finance.accounts:
  finance.users:
    disabled: true
  finance.departments:
    object: '{target_schema}.finance_departments_old' # overwrite default object
    source_options:
      empty_as_null: false
  finance."Transactions":
    mode: incremental # overwrite default mode
    primary_key: id
    update_key: last_updated_at
  1. Add your Connection credentials to your Github Secrets. In our example above, we need to set the connection URL strings as secrets in MY_POSTGRES and MY_SNOWFLAKE. See here for examples.

  2. Add this step to your Github Actions workflow:

steps:
  - uses: slingdata-io/sling-action@v2
    with:
      command: run -r my-replication.yaml
    env:
      MY_POSTGRES: ${{ secrets.MY_POSTGRES }}
      MY_SNOWFLAKE: ${{ secrets.MY_SNOWFLAKE }}
  1. Run your action! Reach out to [email protected] if facing any issues.