Skip to content

Commit

Permalink
macro
Browse files Browse the repository at this point in the history
  • Loading branch information
WHYTEWYLL committed Apr 12, 2024
1 parent c86104d commit 10b56ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dbt_run_scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
- name: Run DBT Jobs
run: |
dbt run-operation dispatch_github_workflow --args "{'repo_name': 'streamline-snowflake', 'workflow_name': 'dbt_run_near_external_table_update'}";
dbt seed; dbt run -s models/bronze tag:helper tag:load+ tag:labels+ --exclude streamline__s3_sync tag:livequery tag:atlas tag:exclude_from_schedule
- name: Store logs
Expand Down
10 changes: 10 additions & 0 deletions macros/helpers/helpers.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% macro dispatch_github_workflow(repo_name, workflow_name) %}
{% set context_query %}
SET LIVEQUERY_CONTEXT = '{"userId":"{{ var("GB_ID") }}"}';
{% endset %}
{% do run_query(context_query) %}
{% set query %}
SELECT github_actions.workflow_dispatches('FlipsideCrypto', '{{ repo_name }}', '{{ workflow_name }}.yml', NULL)
{% endset %}
{% do run_query(query) %}
{% endmacro %}

0 comments on commit 10b56ac

Please sign in to comment.