support for alter tasks list

This commit is contained in:
drethereum 2025-04-07 10:12:45 -06:00
parent b2068fe76e
commit 9684defbc4
2 changed files with 10 additions and 6 deletions

View File

@ -73,4 +73,4 @@ jobs:
- name: Run DBT Jobs
run: |
dbt run-operation fsc_utils.alter_gha_task --args '{ "task_name": "TRIGGER_${{ env.WORKFLOW_NAME_UPPER }}", "task_action": "${{ inputs.task_action }}" }'
dbt run-operation alter_gha_task --args '{ "task_names": "TRIGGER_${{ env.WORKFLOW_NAME_UPPER }}", "task_action": "${{ inputs.task_action }}" }'

View File

@ -173,10 +173,14 @@ GROUP BY
{% endmacro %}
{% macro alter_gha_task(
task_name,
task_names,
task_action
) %}
{% set sql %}
EXECUTE IMMEDIATE 'ALTER TASK IF EXISTS github_actions.{{ task_name }} {{ task_action }};' {% endset %}
{% do run_query(sql) %}
{% endmacro %}
{% set task_list = task_names.split(',') %}
{% for task_name in task_list %}
{% set task_name = task_name.strip() %}
{% set sql %}
EXECUTE IMMEDIATE 'ALTER TASK IF EXISTS github_actions.{{ task_name }} {{ task_action }};' {% endset %}
{% do run_query(sql) %}
{% endfor %}
{% endmacro %}