From 701b36741472f12845f699e65ca788b9bcfc8779 Mon Sep 17 00:00:00 2001 From: michaeldeongreen Date: Sat, 9 May 2026 04:22:39 -0500 Subject: [PATCH] Add workflow_dispatch trigger to ETL workflows (#28) Adds manual-trigger capability to etl-test.yml and etl-prod.yml so operators can re-run an ETL job without having to push a no-op deploy to retrigger the workflow_run chain. Motivation: workflow_run-triggered runs use the workflow file frozen at the moment the trigger fires (and reruns use that same frozen file, not current main). When a workflow file fix lands on main after a workflow_run has already been created, neither auto-retry nor 'gh run rerun' picks up the fix. The only recovery options were either to wait for the next deploy or to push a no-op commit through the promotion chain. workflow_dispatch removes that friction. Updates the job's if-condition to allow either trigger: - workflow_run: gated on upstream deploy success (unchanged behavior) - workflow_dispatch: always runs GitHub Environment protection rules on Test/Prod still apply to the reusable workflow's job, so any approval gates remain in effect for manual runs. --- .github/workflows/etl-prod.yml | 8 +++++++- .github/workflows/etl-test.yml | 10 +++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/etl-prod.yml b/.github/workflows/etl-prod.yml index 5f57dfd..1d647e6 100644 --- a/.github/workflows/etl-prod.yml +++ b/.github/workflows/etl-prod.yml @@ -15,6 +15,10 @@ on: # The success conclusion gate below skips ETL when a deploy was skipped. workflows: ["Deploy to Prod (fabric-cicd)", "Deploy to Prod (Bulk API)"] types: [completed] + # Manual trigger so operators can re-run the ETL without having to fake a + # deploy. The Prod GitHub Environment protection rules still apply to the + # reusable workflow's job, so any approval gates remain in effect. + workflow_dispatch: permissions: contents: read @@ -22,7 +26,9 @@ permissions: jobs: run-etl: name: Run ETL - if: ${{ github.event.workflow_run.conclusion == 'success' }} + # Run when triggered manually, OR when the upstream deploy workflow succeeded. + # workflow_run-triggered runs whose deploy was skipped/failed should not run. + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} uses: ./.github/workflows/reusable-fabric-etl.yml with: environment: Prod diff --git a/.github/workflows/etl-test.yml b/.github/workflows/etl-test.yml index aac7159..1acfe6e 100644 --- a/.github/workflows/etl-test.yml +++ b/.github/workflows/etl-test.yml @@ -15,6 +15,12 @@ on: # The success conclusion gate below skips ETL when a deploy was skipped. workflows: ["Deploy to Test (fabric-cicd)", "Deploy to Test (Bulk API)"] types: [completed] + # Manual trigger so operators can re-run the ETL without having to fake a + # deploy. Useful when a workflow_run-triggered run fails because of a + # transient issue or a workflow file fix that landed on main after the run + # was already created (workflow_run reruns use the workflow file frozen at + # original trigger time, not the current default branch). + workflow_dispatch: permissions: contents: read @@ -22,7 +28,9 @@ permissions: jobs: run-etl: name: Run ETL - if: ${{ github.event.workflow_run.conclusion == 'success' }} + # Run when triggered manually, OR when the upstream deploy workflow succeeded. + # workflow_run-triggered runs whose deploy was skipped/failed should not run. + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} uses: ./.github/workflows/reusable-fabric-etl.yml with: environment: Test